private void updateLoadTransforms() { _loadCondition = new LoadCondition(Forces, Moments); Transform t = Rhino.Geometry.Transform.Identity; if (UseHostLocal) //transformation needed { Vector3d lx = Vector3d.XAxis; //default x,z directions Vector3d lz = Vector3d.Negate(Vector3d.ZAxis); //set localX and localZ directions if pointload has referencepoint and if directions are not zero if (!(ReferencePoint is null)) { if (!ReferencePoint.DirectionLocalX.Equals(Vector3d.Zero)) { lx = ReferencePoint.DirectionLocalX; } if (!ReferencePoint.DirectionLocalZ.Equals(Vector3d.Zero)) { lz = ReferencePoint.DirectionLocalZ; } } t = TransformUtils.GetGlobalTransformPoint(lx, lz); //setup transform } t = Rhino.Geometry.Transform.Translation(new Vector3d(Value.Location)) * t * Rhino.Geometry.Transform.Scale(Point3d.Origin, DrawUtil.ScaleFactorLoads); _loadCondition.Transforms.Add(t); }
private void updateLocalFrameTransforms() { _localFrame.Transforms.Clear(); Transform tScale = Rhino.Geometry.Transform.Scale(Point3d.Origin, DrawUtil.ScaleFactorLocalFrame); Vector3d lx = DirectionLocalX.IsTiny() ? Vector3d.XAxis : DirectionLocalX; Vector3d lz = DirectionLocalZ.IsTiny() ? -1 * Vector3d.ZAxis : DirectionLocalZ; Transform tFinal = TransformUtils.GetGlobalTransformPoint(lx, lz); Transform tTranslate = Rhino.Geometry.Transform.Translation(new Vector3d(Value.Location)); tFinal = tTranslate * tFinal * tScale; _localFrame.Transforms.Add(tFinal); }
private void updateSupportTransforms() { _supp_condition.Transforms.Clear(); Transform tScale = Rhino.Geometry.Transform.Scale(Point3d.Origin, DrawUtil.ScaleFactorSupports); Vector3d lx = DirectionLocalX.IsTiny() ? Vector3d.XAxis : DirectionLocalX; Vector3d lz = DirectionLocalZ.IsTiny() ? Vector3d.ZAxis : DirectionLocalZ; Transform tFinal = Rhino.Geometry.Transform.Identity; if (_supp_condition.LocalFrame) { tFinal = TransformUtils.GetGlobalTransformPoint(lx, lz); } Transform tTranslate = Rhino.Geometry.Transform.Translation(new Vector3d(Value.Location)); tFinal = tTranslate * tFinal * tScale; _supp_condition.Transforms.Add(tFinal); }