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