-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();
+ }
+
+}