1 /*******************************************************************************
\r
2 * Copyright (c) 2012, 2013 Association for Decentralized Information Management in
\r
4 * All rights reserved. This program and the accompanying materials
\r
5 * are made available under the terms of the Eclipse Public License v1.0
\r
6 * which accompanies this distribution, and is available at
\r
7 * http://www.eclipse.org/legal/epl-v10.html
\r
10 * VTT Technical Research Centre of Finland - initial API and implementation
\r
11 *******************************************************************************/
\r
12 package org.simantics.g3d.shape;
\r
14 import java.util.ArrayList;
\r
15 import java.util.List;
\r
17 import javax.vecmath.Vector3d;
\r
19 public class Cylinder {
\r
21 public static Mesh create(Vector3d start, Vector3d dir, double r, int s) {
\r
22 Tube tube = new Tube();
\r
23 tube.setResolution(s);
\r
25 List<Vector3d> vertices = new ArrayList<Vector3d>();
\r
26 vertices.add(start);
\r
27 Vector3d t = new Vector3d(start);
\r
30 tube.setVertices(vertices);
\r
31 return tube.create();
\r