X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=blobdiff_plain;f=org.simantics.g3d%2Fsrc%2Forg%2Fsimantics%2Fg3d%2Fshape%2FCylinder.java;h=4fe564bfaddbd9f080328844375c5bf11e3376ae;hb=58ebeb2baac48f9066c1395a9071f99745574ef9;hp=5398512ef3d36b3122f01db2e478b4ae3e765b94;hpb=498c60eb6adbad0449879bdff55a2e203bfcbb01;p=simantics%2F3d.git diff --git a/org.simantics.g3d/src/org/simantics/g3d/shape/Cylinder.java b/org.simantics.g3d/src/org/simantics/g3d/shape/Cylinder.java index 5398512e..4fe564bf 100644 --- a/org.simantics.g3d/src/org/simantics/g3d/shape/Cylinder.java +++ b/org.simantics.g3d/src/org/simantics/g3d/shape/Cylinder.java @@ -1,34 +1,35 @@ -/******************************************************************************* - * Copyright (c) 2012, 2013 Association for Decentralized Information Management in - * Industry THTH ry. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * VTT Technical Research Centre of Finland - initial API and implementation - *******************************************************************************/ -package org.simantics.g3d.shape; - -import java.util.ArrayList; -import java.util.List; - -import javax.vecmath.Vector3d; - -public class Cylinder { - - public static Mesh create(Vector3d start, Vector3d dir, double r, int s) { - Tube tube = new Tube(); - tube.setResolution(s); - tube.setRadius(r); - List vertices = new ArrayList(); - vertices.add(start); - Vector3d t = new Vector3d(start); - t.add(dir); - vertices.add(dir); - tube.setVertices(vertices); - return tube.create(); - } - -} +/******************************************************************************* + * Copyright (c) 2012, 2013 Association for Decentralized Information Management in + * Industry THTH ry. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * VTT Technical Research Centre of Finland - initial API and implementation + *******************************************************************************/ +package org.simantics.g3d.shape; + +import java.util.ArrayList; +import java.util.List; + +import javax.vecmath.Tuple3d; +import javax.vecmath.Vector3d; + +public class Cylinder { + + public static Mesh create(Vector3d start, Vector3d dir, double r, int s) { + Tube tube = new Tube(); + tube.setResolution(s); + tube.setRadius(r); + List vertices = new ArrayList(); + vertices.add(start); + Vector3d t = new Vector3d(start); + t.add(dir); + vertices.add(dir); + tube.setVertices(vertices); + return tube.create(); + } + +}