Api - model Module
Index
Classes
Interfaces
Functions
- add
OrDelete Segments - add
Unique Points - break
All Paths AtIntersections - break
Along Foreign Path - break
Paths AtIntersections - center
- check
For Equal Overlaps - check
For Overlaps - check
Inside Foreign Model - collect
Loop - combine
- combine
Intersection - combine
Subtraction - combine
Union - convert
Units - count
Child Models - detach
Loop - expand
Paths - find
Chains - find
Loops - follow
- follow
Links - get
First Path From Model - get
Non Zero Segments - get
Opposed Link - get
Similar Model Id - get
Similar Path Id - is
Path Inside Model - mirror
- move
- move
Relative - originate
- outline
- prefix
Path Ids - remove
Dead Ends - rotate
- scale
- simplify
- walk
- walk
Paths - zero
Functions
Private addOrDeleteSegments
-
Parameters
-
crossedPath: ICrossedPath
-
includeInside: boolean
-
includeOutside: boolean
-
keepDuplicates: boolean
-
atlas: Atlas
Returns void
-
Private addUniquePoints
Private breakAllPathsAtIntersections
Private breakAlongForeignPath
-
Parameters
-
crossedPath: ICrossedPath
-
overlappedSegments: ICrossedPathSegment[]
-
foreignWalkedPath: IWalkPath
Returns void
-
breakPathsAtIntersections
center
Private checkForEqualOverlaps
-
Parameters
-
crossedPathsA: ICrossedPathSegment[]
-
crossedPathsB: ICrossedPathSegment[]
-
pointMatchingDistance: number
Returns void
-
Private checkForOverlaps
Private checkInsideForeignModel
-
Parameters
-
segment: IPathInside
-
segmentOffset: IPoint
-
modelToIntersect: IModel
-
modelToIntersectAtlas: Atlas
-
Default value farPoint: IPoint = [7654321, 1234567]
Returns void
-
Private collectLoop
-
Parameters
-
loop: ILoopModel
-
loops: ILoopModel[]
-
detach: boolean
Returns void
-
combine
-
Combine 2 models.
Parameters
-
modelA: IModel
First model to combine.
-
modelB: IModel
Second model to combine.
-
Default value includeAInsideB: boolean = false
Flag to include paths from modelA which are inside of modelB.
-
Default value includeAOutsideB: boolean = true
Flag to include paths from modelA which are outside of modelB.
-
Default value includeBInsideA: boolean = false
Flag to include paths from modelB which are inside of modelA.
-
Default value includeBOutsideA: boolean = true
Flag to include paths from modelB which are outside of modelA.
-
Optional options: ICombineOptions
Returns void
-
combineIntersection
combineSubtraction
combineUnion
convertUnits
countChildModels
-
Count the number of child models within a given model.
Parameters
-
modelContext: IModel
The model containing other models.
Returns number
Number of child models.
-
detachLoop
-
Remove all paths in a loop model from the model(s) which contained them.
Parameters
-
loopToDetach: IModel
The model to search for loops.
Returns void
-
expandPaths
-
Expand all paths in a model, then combine the resulting expansions.
Parameters
-
modelToExpand: IModel
Model to expand.
-
distance: number
Distance to expand.
-
Default value joints: number = 0
Number of points at a joint between paths. Use 0 for round joints, 1 for pointed joints, 2 for beveled joints.
-
Default value combineOptions: ICombineOptions = {}
Returns IModel
Model which surrounds the paths of the original model.
-
findChains
-
Find paths that have common endpoints and form chains.
Parameters
-
modelContext: IModel
The model to search for chains.
-
callback: IChainCallback
-
Optional options: IFindChainsOptions
Optional options object.
Returns void
-
findLoops
-
Find paths that have common endpoints and form loops.
Parameters
-
modelContext: IModel
The model to search for loops.
-
Optional options: IFindLoopsOptions
Optional options object.
Returns IModel
A new model with child models ranked according to their containment within other found loops. The paths of models will be IPathDirectionalWithPrimeContext.
-
Private follow
-
Parameters
-
connections: Collector<IPoint, ILinkedPath>
-
loops: ILoopModel[]
-
detach: boolean
Returns void
-
Private followLinks
-
Parameters
-
connections: Collector<IPoint, IChainLink>
-
chainFound: IChainFound
-
Optional chainNotFound: IChainNotFound
Returns void
-
Private getFirstPathFromModel
Private getNonZeroSegments
Private getOpposedLink
-
Parameters
-
linkedPaths: IChainLink[]
-
pathContext: IPath
Returns IChainLink
-
getSimilarModelId
-
Get an unused id in the models map with the same prefix.
Parameters
-
modelContext: IModel
The model containing the models map.
-
modelId: string
The id to use directly (if unused), or as a prefix.
Returns string
-
getSimilarPathId
-
Get an unused id in the paths map with the same prefix.
Parameters
-
modelContext: IModel
The model containing the paths map.
-
pathId: string
The id to use directly (if unused), or as a prefix.
Returns string
-
isPathInsideModel
-
Check to see if a path is inside of a model.
Parameters
-
pathContext: IPath
The path to check.
-
modelContext: IModel
The model to check against.
-
Optional pathOffset: IPoint
-
Optional farPoint: IPoint
Optional point of reference which is outside the bounds of the modelContext.
-
Optional measureAtlas: Atlas
Returns boolean
Boolean true if the path is inside of the modelContext.
-
mirror
move
moveRelative
originate
-
Moves all of a model's children (models and paths, recursively) in reference to a single common origin. Useful when points between children need to connect to each other.
Parameters
-
modelToOriginate: IModel
The model to originate.
-
Optional origin: IPoint
Optional offset reference point.
Returns IModel
-
outline
-
Outline a model by a specified distance. Useful for accommodating for kerf.
Parameters
-
modelToOutline: IModel
Model to outline.
-
distance: number
Distance to outline.
-
Default value joints: number = 0
Number of points at a joint between paths. Use 0 for round joints, 1 for pointed joints, 2 for beveled joints.
-
Default value inside: boolean = false
Optional boolean to draw lines inside the model instead of outside.
Returns IModel
Model which surrounds the paths outside of the original model.
-
prefixPathIds
removeDeadEnds
-
Remove paths from a model which have endpoints that do not connect to other paths.
Parameters
-
modelContext: IModel
The model to search for dead ends.
-
Optional pointMatchingDistance: any
-
Optional keep: IWalkPathBooleanCallback
Returns IModel
The input model (for chaining).
-
rotate
scale
simplify
-
Simplify a model's paths by reducing redundancy: combine multiple overlapping paths into a single path. The model must be originated.
Parameters
-
modelToSimplify: IModel
-
Optional options: ISimplifyOptions
Optional options object.
Returns IModel
The simplified model (for chaining).
-
walk
-
Recursively walk through all paths for a given model.
Parameters
-
modelContext: IModel
The model to walk.
-
options: IWalkOptions
Returns void
-
walkPaths
-
Recursively walk through all paths for a given model.
Parameters
-
modelContext: IModel
The model to walk.
-
callback: IModelPathCallback
Callback for each path.
Returns void
-
zero
Generated using TypeDoc