X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=blobdiff_plain;ds=sidebyside;f=org.simantics.opencascade%2Fsrc%2Forg%2Fsimantics%2Fopencascade%2FOccTriangulator.java;h=3cc0ff4dd5af0bbbca829a300b890ee8b9a90415;hb=0f1acf557db4515528bc452c037db0831fd34ecf;hp=e545a69c742ac69403a5a3bdda64356de2e58a9a;hpb=87b3241ec277ba3d8e414b26186a032c9cdcaeed;p=simantics%2F3d.git diff --git a/org.simantics.opencascade/src/org/simantics/opencascade/OccTriangulator.java b/org.simantics.opencascade/src/org/simantics/opencascade/OccTriangulator.java index e545a69c..3cc0ff4d 100644 --- a/org.simantics.opencascade/src/org/simantics/opencascade/OccTriangulator.java +++ b/org.simantics.opencascade/src/org/simantics/opencascade/OccTriangulator.java @@ -1,7 +1,7 @@ package org.simantics.opencascade; /******************************************************************************* - * Copyright (c) 2007- VTT Technical Research Centre of Finland. + * Copyright (c) 2007, 2013- VTT Technical Research Centre of Finland. * 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 @@ -114,6 +114,18 @@ public class OccTriangulator { return tds; } + + public static TopoDS_Shape makeTorus(double[] pointStruct, double[] dirStruct, double[] dirStruct2, double r1, double r2) { + double[] axe = new double[9]; + System.arraycopy(pointStruct, 0, axe, 0, 3); + System.arraycopy(dirStruct, 0, axe, 3, 3); + System.arraycopy(dirStruct2, 0, axe, 6, 3); + BRepPrimAPI_MakeTorus torus = new BRepPrimAPI_MakeTorus(axe, r1, r2); + org.jcae.opencascade.jni.TopoDS_Shape tds = torus.shape(); + torus.delete(); + return tds; + } + public static TopoDS_Shape makeTorus(double[] pointStruct, double[] dirStruct, double r1, double r2, double angle1, double angle2, double angle) { double[] axe = new double[6]; System.arraycopy(pointStruct, 0, axe, 0, 3); @@ -123,6 +135,17 @@ public class OccTriangulator { torus.delete(); return tds; } + + public static TopoDS_Shape makeTorus(double[] pointStruct, double[] dirStruct, double[] dirStruct2, double r1, double r2, double angle1, double angle2, double angle) { + double[] axe = new double[9]; + System.arraycopy(pointStruct, 0, axe, 0, 3); + System.arraycopy(dirStruct, 0, axe, 3, 3); + System.arraycopy(dirStruct2, 0, axe, 6, 3); + BRepPrimAPI_MakeTorus torus = new BRepPrimAPI_MakeTorus(axe, r1, r2,angle1,angle2,angle); + org.jcae.opencascade.jni.TopoDS_Shape tds = torus.shape(); + torus.delete(); + return tds; + } public static TopoDS_Shape makeSphere(double x, double y, double z, double radius) { double[] c = new double[] { x, y, z };