From: Reino Ruusu Date: Thu, 30 Apr 2020 09:31:05 +0000 (+0300) Subject: Change rotation angle 0 to flat-side-down in eccentric reducers X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=commitdiff_plain;h=refs%2Fchanges%2F37%2F4237%2F1;p=simantics%2F3d.git Change rotation angle 0 to flat-side-down in eccentric reducers gitlab #125 Change-Id: Ia4ed51a0c25496f8ac5fd4fa3fbbd1920e7a938b (cherry picked from commit 1746010c9ddf01ccc755dd9f398665800515d575) --- diff --git a/org.simantics.plant3d/src/org/simantics/plant3d/geometry/ReducerGeometryProvider.java b/org.simantics.plant3d/src/org/simantics/plant3d/geometry/ReducerGeometryProvider.java index c793fd26..c82eab56 100644 --- a/org.simantics.plant3d/src/org/simantics/plant3d/geometry/ReducerGeometryProvider.java +++ b/org.simantics.plant3d/src/org/simantics/plant3d/geometry/ReducerGeometryProvider.java @@ -53,7 +53,7 @@ public class ReducerGeometryProvider extends BuiltinMeshProvider { List radius = new ArrayList(); List tangents = new ArrayList(); vertices.add(new Point3d(-length*0.5, 0.0, 0.0)); - vertices.add(new Point3d( length*0.5, offset, 0.0)); + vertices.add(new Point3d( length*0.5, -offset, 0.0)); radius.add(this.radius); radius.add(this.radius2); tangents.add(new Vector3d(1.0,0.0,0.0)); diff --git a/org.simantics.plant3d/src/org/simantics/plant3d/scenegraph/controlpoint/PipeControlPoint.java b/org.simantics.plant3d/src/org/simantics/plant3d/scenegraph/controlpoint/PipeControlPoint.java index f5db5880..c5934b36 100644 --- a/org.simantics.plant3d/src/org/simantics/plant3d/scenegraph/controlpoint/PipeControlPoint.java +++ b/org.simantics.plant3d/src/org/simantics/plant3d/scenegraph/controlpoint/PipeControlPoint.java @@ -481,7 +481,7 @@ public class PipeControlPoint extends G3DNode implements IP3DNode { q = getControlPointOrientationQuat(dir, 0.0); else q = getControlPointOrientationQuat(dir, rotationAngle); - Vector3d v = new Vector3d(0.0,offset,0.0); + Vector3d v = new Vector3d(0.0,-offset,0.0); Vector3d offset = new Vector3d(); MathTools.rotate(q, v, offset); return offset; @@ -493,7 +493,7 @@ public class PipeControlPoint extends G3DNode implements IP3DNode { q = getControlPointOrientationQuat(0.0); else q = getControlPointOrientationQuat(rotationAngle); - Vector3d v = new Vector3d(0.0,offset,0.0); + Vector3d v = new Vector3d(0.0,-offset,0.0); Vector3d offset = new Vector3d(); MathTools.rotate(q, v, offset); return offset;