public SegmentVector(SegmentVector other) : this(kdlPINVOKE.new_SegmentVector__SWIG_1(SegmentVector.getCPtr(other)), true) { if (kdlPINVOKE.SWIGPendingException.Pending) { throw kdlPINVOKE.SWIGPendingException.Retrieve(); } }
public SegmentVectorEnumerator(SegmentVector collection) { collectionRef = collection; currentIndex = -1; currentObject = null; currentSize = collectionRef.Count; }
public void SetRange(int index, SegmentVector values) { kdlPINVOKE.SegmentVector_SetRange(swigCPtr, index, SegmentVector.getCPtr(values)); if (kdlPINVOKE.SWIGPendingException.Pending) { throw kdlPINVOKE.SWIGPendingException.Retrieve(); } }
public void AddRange(SegmentVector values) { kdlPINVOKE.SegmentVector_AddRange(swigCPtr, SegmentVector.getCPtr(values)); if (kdlPINVOKE.SWIGPendingException.Pending) { throw kdlPINVOKE.SWIGPendingException.Retrieve(); } }
public static SegmentVector Repeat(Segment value, int count) { global::System.IntPtr cPtr = kdlPINVOKE.SegmentVector_Repeat(Segment.getCPtr(value), count); SegmentVector ret = (cPtr == global::System.IntPtr.Zero) ? null : new SegmentVector(cPtr, true); if (kdlPINVOKE.SWIGPendingException.Pending) { throw kdlPINVOKE.SWIGPendingException.Retrieve(); } return(ret); }
public SegmentVector GetRange(int index, int count) { global::System.IntPtr cPtr = kdlPINVOKE.SegmentVector_GetRange(swigCPtr, index, count); SegmentVector ret = (cPtr == global::System.IntPtr.Zero) ? null : new SegmentVector(cPtr, true); if (kdlPINVOKE.SWIGPendingException.Pending) { throw kdlPINVOKE.SWIGPendingException.Retrieve(); } return(ret); }
/// <summary> /// 폴리라인의 각 변마다 거리를 지정해 Offset 커브를 만들어줍니다. /// </summary> public static List <Curve> ImprovedOffset(Polyline bound, List <double> offsetDist) { Polyline ccwBound = AlignPolyline(bound); List <Point3d> trimmedOffsetPt = new List <Point3d>(); //set vectors List <Vector3d> alignVector = SegmentVector.GetAlign(ccwBound, true); List <Vector3d> perpVector = SegmentVector.GetPerpendicular(ccwBound, true); List <Point3d> boundVertex = GetVertex(ccwBound); int numSegment = alignVector.Count; int numVertex = boundVertex.Count; //offset and trim segments for (int i = 0; i < numSegment; i++) { double a = offsetDist[i]; double b = offsetDist[(i + 1) % offsetDist.Count]; double dotProduct = Vector3d.Multiply(alignVector[i], alignVector[(i + 1) % numSegment]); Vector3d crossProduct = Vector3d.CrossProduct(alignVector[i], alignVector[(i + 1) % numSegment]); double cos = Math.Abs(dotProduct / (alignVector[i].Length * alignVector[(i + 1) % numSegment].Length)); double sin = Math.Sqrt(1 - Math.Pow(cos, 2)); double decider1 = Vector3d.Multiply(Plane.WorldXY.ZAxis, crossProduct); double decider2 = Vector3d.Multiply(-alignVector[i], alignVector[(i + 1) % numSegment]); Point3d tempPt = new Point3d(); if (decider1 > 0.005) // concave { if (decider2 < 0) // blunt { tempPt = boundVertex[(i + 1) % numVertex] + perpVector[i] * a + alignVector[i] * ((a * cos - b) / sin); } else // acute (right angle included) { tempPt = boundVertex[(i + 1) % numVertex] + perpVector[i] * a + alignVector[i] * ((-a * cos - b) / sin); } } else if (decider1 < -0.005) // convex { if (decider2 < 0) //blunt { tempPt = boundVertex[(i + 1) % numVertex] + perpVector[i] * a + alignVector[i] * ((-a * cos + b) / sin); } else // acute (right angle included) { tempPt = boundVertex[(i + 1) % numVertex] + perpVector[i] * a + alignVector[i] * ((a * cos + b) / sin); } } else //straight & near straight { tempPt = boundVertex[(i + 1) % numVertex] + perpVector[i] * Math.Max(a, b); } trimmedOffsetPt.Add(tempPt); } trimmedOffsetPt.Add(trimmedOffsetPt[0]); Polyline offBound = new Polyline(trimmedOffsetPt); //remove loop //List<Curve> loopOut = RemoveLoop(offBound, ccwBound, 0.001); //return loopOut; List <Curve> debug = new List <Curve>(); debug.Add(offBound.ToNurbsCurve()); return(debug); }
internal static global::System.Runtime.InteropServices.HandleRef getCPtr(SegmentVector obj) { return((obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr); }