Polyline

Public Class Polyline
Inherits Entity
Implements IToPolylines

A linked line containing straight line segments and arcs.
This Polyline is modeled on DXF Polylines.

Properties

CADFile
readonly

CADFile
The name of the layer that contains this primitive.

 
CanConvertToPolylines
readonly

System.Boolean
 

 
Closed

System.Boolean
True if the Polyline is close (i.e. the last point is connected to the first point)

 
Direction
readonly

CamBam.Geom.RotationDirection
 

 
FirstPoint
readonly
Point3F FirstPoint  
HasArcs
readonly

bool HasArcs

 
ID

System.Int32
This is a unique ID used to select objects within scripts.

 
LastPoint
readonly

Point3F lastPoint

 
Layer
readonly

Layer
The name of the layer that contains this primitive.

 
NumSegments
readonly

System.Int32
 

 
Parent

System.Object
This primitive's parent object. This may be a GOBLayer.

 
Points

CamBam.CAD.PolylineItemList
An array of PolylineItem objects that define the Polyline.

PrimitiveType
readonly

System.String
A string representation of this primitive's type

 
SubPrimitives
readonly

System.Collections.ArrayList
Used internally.

 
Tag

System.String
 

 
Transform

CamBam.Geom.Matrix4x4F
 

 

Methods

Add
Void Add (Point3F p)
Add
Void Add (Point3F p, Double bulge)  
Add
Void Add (Double x, Double y, Double z, Double bulge)  
Add
Void Add (Double x, Double y, Double z, Double bulge, Double tolerance)  
Add
Void Add (Double x, Double y, Double z)  
Add
Void Add (Object o, Double tolerance)  
Add
Void Add (Line2F line, Double tolerance)  
Add
Void Add (Line3F line, Double tolerance)  
Add
Void Add (Arc2F arc, Double tolerance)  
AddQuadratic
Void AddQuadratic (Quadratic2F q, Double tolerance)  
ApplyTransformation Boolean ApplyTransformation (Matrix4x4F xm)
Multiply the points in the object by a transformation matrix.
 
ApplyTransformation
Boolean ApplyTransformation (Matrix4x4F xm, Boolean check_arcs)
Multiply the points in the object by a transformation matrix.
 
ArcFit Polyline ArcFit(double tolerance)  
ArcIntersections
Point2F[] ArcIntersections (Arc2F arc, Double tolerance)  
BreakClosedAtSegment
Polyline BreakClosedAtSegment (Int32 segment)  
BreakClosedAtSegment
Polyline BreakClosedAtSegment (Int32 segment, Point2F pt, Double tolerance)  
BulgeDirection
static
Int32 BulgeDirection (Matrix4x4F xm)  
CheckForClosed
Boolean CheckForClosed (Double tolerance)  
Clone
Entity Clone ()  
CloneFrom
Void CloneFrom (Entity src)  
ConvertToPolylines
Polyline[] ConvertToPolylines (Boolean apply_transformations)  
CreateOffsetPolyline

Polyline[ ] CreateOffsetPolyline (Double offset, Double tolerance)
Creates an offset polyline from the source polyline. The resulting polyline is stored in the first element of the Polyline Array

CreateOffsetPolyline

Polyline[ ] CreateOffsetPolyline (Double offset, Double tolerance, Boolean cornerovercut, Boolean vcorner)
Creates an offset polyline from the source polyline with corner overcut. The resulting polyline is stored in the first element of the Polyline Array
(currently, vcorner seems to have no effect)

DumpToCADFile
Void DumpToCADFile (String filename)  
FindLoopPoints
Point2F[] FindLoopPoints (Double tolerance)  
FindLoopPoints
Point2F[] FindLoopPoints (Double tolerance, Boolean check_near_points)  
Flatten
Boolean Flatten (Double z)
Flatten 3D shape into Z plane
Parameters:
z:
GetCentroid
Point3F GetCentroid ()  
GetExtents
Void GetExtents (PointF min, PointF max)
Find the extrema points of this primitive.
Parameters:
min: A point that will receive the minimum coordinates.
max: A point that will receive the maximum coordinates.
 
GetExtrema
Void GetExtrema (Point3F min, Point3F max)
Find the extrema points of this primitive.
Parameters:
min: A point that will receive the minimum coordinates.
max: A point that will receive the maximum coordinates.
 
GetNearestPoint
Point3F GetNearestPoint (Point2F p, Vector2F VNormal, Int32 NearestSegment)  
GetNearestPoint
Point3F GetNearestPoint (Point2F p, Vector2F VNormal, Int32 NearestSegment, Boolean expanded_search)  
GetParametricPoint
Double GetParametricPoint (Point2F p, Vector2F VNormal)  
GetParametricPoint
Point3F GetParametricPoint (Double u)  
GetPerimeter
Double GetPerimeter ()
Return the perimeter for a closed polyline or the lenght for an open polyline.
 
GetRegion
Rect2F GetRegion ()  
GetScreenExtents
Void GetScreenExtents (PointF min, PointF max, Matrix4x4F xm)  
GetSegment

Polyline GetSegment (Double u, Double v)

Return a polyline that is a part of the source polyline, starting at u and ending at v (in current units)

ex: u = 5, v = 20, return a polyline of a total lenght = 15 units (20-5) and that start 5 units after the start point of the source polyline.

* if u and v are reverted, the resulting polyline is the same, but its direction is reversed
* u and v must not be equal because polyline of null lenght.
* if the asked lenght is bigger than the lenght of the source polyline, all the polyline (after the sart point) is returned.

 

 

VB

GetSegment
Object GetSegment (Int32 i, Boolean apply_transform)
Returns the geometric object at a given segment.
Parameters:
i: The index of the segment to return.
Returns: A Line2F object if bulge = 0 or an Arc2F if the bulge > 0. If the index is out of bounds, a null is returned.
 
GetSegment

Object GetSegment (Int32 i)

i The index of the segment to return.
the number of segments can be found in Polyline.NumSegments

InsertPoint
Int32 InsertPoint (Point2F pt, Double tolerance)  
InsertSegmentAfter
Void InsertSegmentAfter (Int32 seg, PolylineItem pitem)  
InsertSegmentAfter
Void InsertSegmentAfter (Int32 seg)  
InsertSegmentAtPoint
Int32 InsertSegmentAtPoint (Point2F pt, Double tolerance)  
InsertSegmentBefore
Void InsertSegmentBefore (Int32 seg, PolylineItem pitem)  
InsertSegmentBefore
Void InsertSegmentBefore (Int32 seg)  
Intersects

Boolean Intersects (Polyline poly)
Return true if poly intersect with this polyline

Join
static
Polyline[] Join (Polyline[] pols, Double tolerance)  
JoinPolylines_NEW2
static
Polyline[] JoinPolylines_NEW2 (Polyline[] plines, Double tolerance)  
JoinPolylines
static
Polyline JoinPolylines (Polyline[] plines, Double tolerance)  
LineIntersections
Point2F[] LineIntersections (Line2F line, Double tolerance)  
NearestSegment
Int32 NearestSegment (Point2F p, Double tolerance)  
NextSegment
Int32 NextSegment (Int32 seg)  
Paint
Void Paint (Display3D d3d)  
Paint
Void Paint (Display3D d3d, Color ArcColor, Color LineColor)  
PointInPolyline2
Boolean PointInPolyline2 (Point2F p, Double tolerance)  
PointInPolyline
Boolean PointInPolyline (Point2F p, Double tolerance)  
PointIntersect
Boolean PointIntersect (Point2F p, Matrix4x4F xm, Double tolerance)
Returns true if a point will intersect part of the primitive. Used for mouse hit testing.
Parameters:
p: The test point.
xm: Transformation matrix.
tolerance: How close the point must be to be considered a hit.
Returns:
 
PolylineInsidePolyline
Boolean PolylineInsidePolyline (Polyline poly)
Returns true if 'poly' is within this polyline.
WARNING! Should first check if the polylines intersect, otherwise this test can be unreliable!!
Parameters:
poly:
Returns:
PolylineInsidePolyline
Boolean PolylineInsidePolyline (Polyline poly, Double tolerance)
Check whether a polyline us within this polyline.
NOTE: Only tests control points.
Parameters:
poly:
Returns: true or false
 
PolylineIntersections
static
Point2F[] PolylineIntersections (Polyline poly1, Polyline poly2, Double tolerance)  
PolylineOutsidePolyline
Boolean PolylineOutsidePolyline (Polyline poly, Double tolerance)  
PolylineSubtract
static
Polyline[] PolylineSubtract (Polyline p1, Polyline p2, Double tolerance)  
PolylineTrim
static
Polyline[] PolylineTrim (Polyline p1, Polyline p2, Double tolerance)  
PrevSegment
Int32 PrevSegment (Int32 seg)  
RemoveArcs Polyline RemoveArcs(double tolerance)  
RemoveDuplicatePoints

Boolean RemoveDuplicatePoints (Double tolerance)
Merges the points that are at a distance less than the given tolerance.

Reverse

Void Reverse ()
Reverse the direction of the polyline

 
SegmentLength
Double SegmentLength (Int32 seg)  
SegmentPolyline
Polyline SegmentPolyline (Double step)  
SmallerThan
Boolean SmallerThan (Double threshold)  
SpanDistance
Double SpanDistance (Int32 s1, Int32 s2)  
SplitAtLoopPoints
Polyline[] SplitAtLoopPoints (Double tolerance)  
SplitAtPoint3D
Polyline[] SplitAtPoint3D (Point2F pt, Double tolerance)  
SplitAtPoint
Polyline[] SplitAtPoint (Int32 segment, Point2F pt, Double tolerance)  
SplitAtPoint
Polyline[] SplitAtPoint (Point2F pt, Double tolerance)  
SplitAtPoints3D
Polyline[] SplitAtPoints3D (Point2F[] pts, Double tolerance)  
SplitAtPoints
Polyline[] SplitAtPoints (Point2F[] pts, Double tolerance)  
SplitAtSegment
Polyline[] SplitAtSegment (Int32 segment)  
ToNewStartPoint
Polyline ToNewStartPoint (Int32 segment)  
ToPrimitives
Entity[] ToPrimitives ()  
Update
Void Update ()
Instructs the primitive to refresh any internal data if the the object has changed.
 
Copyright (c) 2011 HexRay Ltd