Take Dimensions associated with current Shape to the projected 2D shape NOTE: We can not yet associate dimensions with ShapeCollections, so we link it to the specific Shape within this collection
Copy Shape a number of times by spacing by a certain offset Vector
Calculate the closest distance between two Shapes: returns one or more straight Link Object, where start is from the first Shape NOTE: If two Shapes are the same and parallel ( for example two Edges ) two links for each Vertex are returned
Generate elevation from a given side without adding to Scene
Optional
side: SideOptional
all: booleanSometimes (for example in intersections) OCE returns a Compound Shape: Try to get real singular Shape
Make Shape from OC Shape if given, otherwise update properties based on current _ocShape
Get all geometries in this shape, you can specify the types (Vertex, Edge, Wire etc)
Get all subshapes of given type and those of lower types
Get 'side view' Edges, Wire or (TODO) Shells and Solid: !!!! REFACTOR NEEDED - WORKS ONLY FOR 2D !!!! NOTE: Sides really only make sense with closed Shapes: but we keep it in also for Wires
Returns the shared Shape between two Shapes (private)
Calculate intersection between Shapes ( from Face onward ) based on Common algoritm
Calculate intersection with Section algorithm: This works for all Shape types but only returns Vertices or Edges
Generate isometric view from Side or corner of ViewCube ('frontlefttop') or PointLike coordinate Use showHidden=true to output with hidden lines
Offset Edge a given amount into normal direction or reversed with '-amount' and return new Edge (private without adding to Scene) NOTE: param type does nothing but is for consistency
Optional
amount: numberOptional
type: stringOptional
onPlaneNormal: PointLikeProject this 3D Shape onto the XY Plane given by a normal Vector (up is the z-axis) It groups the different Edge types in the returning Collection for easy extractions Include flag all=true to include hidden Edges
IMPORTANT: Projection of a Solid that contains a certain Edge results in different alignment when projecting that Edge individually
TODO: find a way to identify edges/vertices from before and after projection for example to preserve dimensions
Optional
planeNormal: PointLikeOptional
all: booleanMake a new Shape by revolving a non-solid Shape around an axis given by two Points (Private)
Select Shapes that have all vertices at a specific coordinate within a certain tolerance NOTE: we might introduce a selector later where we select Shapes that intersect a certain coordinate plane
Sort and select Shapes based on distance to a Point - this method combines closest or furthest
Selector: BiggestAlongAxis Selects the Shape(s) that has the biggest coordinate along a certain axis - we use center and max
Select Shapes of which all the Vertices fit inside the given Bbox coordinates: We use Bbox.contains
Select SubShapes by index or indices
Selects all Shapes that have negative coordinates along given axis
Selects shapes of a certain subtype
Selector: ParallelTo
string with axis name (X|Y|Z) or Array with coords [X,Y,Z]
Selects all Shapes that have positive coordinates along given axis
Selects Shapes that intersect with the sides of the Bbox example: "V||fronttop"
Thicken Shell or Solid to create a hollow Solid (private)
Optional
excludeFaces: AnyShapeOrCollectionOrSelectionStringOptional
type: stringCutting in OC with two Faces does not work We hack a little by giving a slight height to the operants
Split current Shape into multiple ones using the given other Shapes (Private method: without adding to Scene) The other Shapes are removed after the operation
Thicken Edge to create a Face (private: without adding result to Scene)
Optional
amount: numberOptional
direction: ThickenDirectionOptional
onPlaneNormal: PointLikeUnions one with another Shape (Private method without adding to Scene)
Alias for union
Alias for unioned
Align a given Shape to another by supplying a pivot for current Shape, another Shape and the alignment For the pivot and alignment you can supply either a string with the combinations of sides (left,right,front,back,bottom,top) or a array of percentage offsets to [left,front,bottom] corner or Shape and for linear Shapes (Edge,Wire) also start and end !!!! TODO !!!!
Move, rotate and (later) scale a Shape based on given points on the Shape and destination points NOTE: you need two points for 2D alignment, 3 points for 3D alignment with rotation TODO: Add scaling
Optional
from: LinearShapeTailOptional
to: LinearShapeTailCopy current Shape a number of times along X,Y,Z axis with a given spacing
Copies a Shape along a linear path
Alias for array along x-axis
Optional
size: numberOptional
offset: numberAlias for array along y-axis
Optional
size: numberOptional
offset: numberAlias for array along z-axis
Optional
size: numberOptional
offset: numberGet attributes of Shape
Limit a Shape by others: Always returns a single Shape of the same type
If not given we get all intersecting Shapes
Get closest Point on the other Shape
Alias for union
Alias for unioned
Test if a one Shape completely contains the other. If other is ShapeCollection test if all its Shapes are contained by current Shape
Optional
dim: DimensionOptionsSorts objects by distance in a certain axis (X,Y,Z) and direcion (- or +)
string with axis, direction and count: X, -Z - TODO num (unique results)[2]
Calculate the distance between this Shape and other
Rest
...args: any[]Returns a Link that is the shortest path from current Shape to the other
Returns the Vector of closest path from current Shape to the other
Get all Edges of this Shape
Generate elevation from a given side and add to Scene
Optional
side: SideOptional
all: booleanIs exactly the same Shape based on its topology/geometry IMPORTANT: this will not always work!
Extend Edge into a given direction (start or end)
Optional
amount: numberOptional
direction: LinearShapeTailExtend Edge into a certain direction (start or end) and return a copy
Optional
amount: numberOptional
direction: LinearShapeTailGeneric Shape extrude: basically meaning pulling a shape along a Vector for a distance to create a new Shape with higher dimensions
For example: Extrude a straight Line along a the z-axis to create a Rectangular Face
TODO: solid flag
Optional
amount: numberOptional
direction: PointLikeExtrude this Shape towards a given Point or other Shape - we do keep the normal of the Shape if available
Rest
...args: any[]Get all Faces of this Shape
Alias for union
Alias for unioned
Return first Shape of intersections and replace current Shape
Return first Shape of intersections as copy
Get all Shapes in Scene that are intersecting with this Shape
Returns the shared Shape between two Shapes
Alias for isometry()
Generate isometric view from Side or corner of ViewCube ('frontlefttop') or PointLike coordinate Use showHidden=true to output with hidden lines
Get the shortest lines from Shape to the other
Loft (forwarded to Wire)
Optional
solid: booleanOptional
solid: booleanMake Bezier curve from given points. One control point for Quadratic. Two for Cubic
Rest
...args: any[]Make Spline that goes through Vectors provided in list of points (PointLike)
Rest
...args: any[]Alias for union
Alias for unioned
Generate a Collection of a given number of Vertices equally spaced over this Edge including the start and end of the Edge
Optional
num: numberProject this 3D Shape onto the XY Plane given by a normal Vector (up is the z-axis) It groups the different Edge types in the returning Collection for easy extractions
Optional
planeNormal: PointLikeOptional
all: booleanSome operations on Shape actually create new Shape types: For example Shape.intersections(other) To Updating those in place we use the Obj container of the Shape
Make a new Shape by revolving a non-solid Shape around an axis given by two Points
Rotation around X,Y,Z axis with a given pivot (default: center) NOTE: because the order of these rotations if very important we don't call it just rotate. Use rotateX, rotateY and rotateZ to rotate around the main axis
Optional
degY: numberOptional
degZ: numberOptional
pivot: PivotBreak a curved Edge up into a Wire consisting of Line Edges with given angle between segments
Optional
angle: numberOptional
size: numberSelect parts of this Shape
examples: cube.select('Edges|Z') cube.select('F>|front and F>|back) - multiple
Same as shelled but with replacing the original
Optional
excludeFaces: AnyShapeOrCollectionOrSelectionStringOptional
type: stringThicken Face, Shell or Solid to create a hollow Solid (private)
Optional
excludeFaces: AnyShapeOrCollectionOrSelectionStringOptional
type: stringGet all Shells of this Shape
Get all Solids of this Shape
Split current Shape into multiple ones using the given other Shapes
Create a new Shape by sweeping a the Shape's Wire representation through a Wire Path
Optional
solid: booleanOptional
autoRotate: booleanOptional
alignToPath: stringOptional
direction: ThickenDirectionOptional
onPlaneNormal: PointLikeOutput triangulated Mesh of Faces of this Shape
Exports OC data to verbose mesh data for Three JS. To avoid clear seperation between AY Geom library and Three we output here raw data There are interfaces defined in ExportModels.ts for clarity
Output all Vertices of this Shape into an Array for further processing
Same as unioned but replacing current Shape in Obj
Unions one with another Shape
Get all Vertices of this Shape
Get all Wires of this Shape
Static
fromStatic
isGenerated using TypeDoc
Creates a simple Line Edge, use new Edge().makeCicle etc for others