]> gerrit.simantics Code Review - simantics/3d.git/commitdiff
Change rotation angle 0 to flat-side-down in eccentric reducers 99/4199/1
authorReino Ruusu <reino.ruusu@semantum.fi>
Thu, 30 Apr 2020 09:31:05 +0000 (12:31 +0300)
committerReino Ruusu <reino.ruusu@semantum.fi>
Thu, 30 Apr 2020 09:31:05 +0000 (12:31 +0300)
gitlab #125

Change-Id: Ia4ed51a0c25496f8ac5fd4fa3fbbd1920e7a938b

org.simantics.plant3d/src/org/simantics/plant3d/geometry/ReducerGeometryProvider.java
org.simantics.plant3d/src/org/simantics/plant3d/scenegraph/controlpoint/PipeControlPoint.java

index c793fd26f6b65fa9e3fb1738a84e4224192a22e4..c82eab565bbafda5835a1cb69b55efbf962c8008 100644 (file)
@@ -53,7 +53,7 @@ public class ReducerGeometryProvider extends BuiltinMeshProvider  {
                List<Double> radius = new ArrayList<Double>();
                List<Vector3d> tangents = new ArrayList<Vector3d>();
                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));
index f5db5880b5a1e3be8cfe042af19cdb64167faddf..c5934b368edfe64987a79194f0a4a61146543617 100644 (file)
@@ -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;