]> gerrit.simantics Code Review - simantics/3d.git/blobdiff - org.simantics.g3d/src/org/simantics/g3d/shape/Cylinder.java
Mesh API to use Tuple3d instead of Vector3d
[simantics/3d.git] / org.simantics.g3d / src / org / simantics / g3d / shape / Cylinder.java
index 5398512ef3d36b3122f01db2e478b4ae3e765b94..4fe564bfaddbd9f080328844375c5bf11e3376ae 100644 (file)
@@ -1,34 +1,35 @@
-/*******************************************************************************\r
- * Copyright (c) 2012, 2013 Association for Decentralized Information Management in\r
- * Industry THTH ry.\r
- * All rights reserved. This program and the accompanying materials\r
- * are made available under the terms of the Eclipse Public License v1.0\r
- * which accompanies this distribution, and is available at\r
- * http://www.eclipse.org/legal/epl-v10.html\r
- *\r
- * Contributors:\r
- *     VTT Technical Research Centre of Finland - initial API and implementation\r
- *******************************************************************************/\r
-package org.simantics.g3d.shape;\r
-\r
-import java.util.ArrayList;\r
-import java.util.List;\r
-\r
-import javax.vecmath.Vector3d;\r
-\r
-public class Cylinder {\r
-       \r
-       public static Mesh create(Vector3d start, Vector3d dir, double r, int s) {\r
-               Tube tube = new Tube();\r
-               tube.setResolution(s);\r
-               tube.setRadius(r);\r
-               List<Vector3d> vertices = new ArrayList<Vector3d>();\r
-               vertices.add(start);\r
-               Vector3d t = new Vector3d(start);\r
-               t.add(dir);\r
-               vertices.add(dir);\r
-               tube.setVertices(vertices);\r
-               return tube.create();\r
-       }\r
-\r
-}\r
+/*******************************************************************************
+ * 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<Tuple3d> vertices = new ArrayList<Tuple3d>();
+               vertices.add(start);
+               Vector3d t = new Vector3d(start);
+               t.add(dir);
+               vertices.add(dir);
+               tube.setVertices(vertices);
+               return tube.create();
+       }
+
+}