Hierarchy

Constructors

Properties

Methods

_addAnnotation _addDimensionsToProj _addEntities _alignPerc _alignStringToAlignPerc _array1D _axisAndPlanesToVector _checkAxis _closestLinks _copy _copyAttributes _distanceAxis _distanceToShape _elevation _extractShapesFromOcCompound _flattened _fromOcShape _fromOcWire _fromShapeCollection _fromWire _getColorRGBA _getEntities _getEntitiesDownFromType _getOBbox _getObjStyle _getOcShapesByType _getShapeTypeFromOcShape _getSide _getSideReal _groupEdges _hasClosingEdges _hashcode _intersections _intersectionsCommon _intersectionsSection _intersectionsWithWire _isometry _lofted _makeSpecificOcShape _mirrored _mirroredX _mirroredY _mirroredZ _ocGeom _offsetted _pointAtPerc _project _revolved _selectorAtAxisCoord _selectorClosestOrFurtherstTo _selectorClosestTo _selectorDistanceAlongAxis _selectorFurthestTo _selectorInBbox _selectorIndex _selectorNegativeOnAxis _selectorOfSubType _selectorOuterAlongAxis _selectorParallelTo _selectorPositiveOnAxis _selectorSide _selectorSmallestAlongAxis _selectorWithinRange _setShapeEnumToClassName _shapeCollectionFromOcCompound _shapeTypeEnumLookup _shelled _solidifyOperantFaces _splitted _subtracted _sweeped _thickened _toEdge _toFace _toOcCurve _toOcCurveHandle _toWire _twistExtruded _unifyDomain _unioned _updateAnnotations _updateFromOcShape _updateOcShape add addToScene added align alignByPoints alignTo alignedByPoints area array arrayAlong arrayX arrayY arrayZ attribute attrs bbox capped center chamfer checkAndFix checkConnections checkDowngrade checkObj close closed closest closestVertex color combine combineEdges combined contains copy count dashed dimension directionAt directionAtEnd directionAtStart directionMinMaxSelector distance distanceLink distanceVec distanceX distanceY distanceZ edgeAtPoint edges elevation end equals extrude extruded extrudedTo faces fillet fromAll fromEdges fromPoints fromVertices fuse fused getColor getCursor getId getName getSubShapes hide intersect intersected intersecting intersection intersections intersects is2D is2DXY isEmpty isShape isShapeCollection iso isometry length links loft lofted makeHelix makeRect makeSpiral max merge merged middle min mirrorX mirrorY mirrorZ mirrored mirroredX mirroredY mirroredZ move moveTo moveToOrigin moveX moveY moveZ moved movedTo name normal normalAt normalAtEnd normalAtStart obbox object ocGeom offset offsetted overlapping overlaps parallel planar pointAt pointAtParam pointAtSide populated position project raycast removeFromScene replaceShape reverse reversed revolved rotate rotateAround rotateEuler rotateToAxesBbox rotateToLayFlat rotateVecToVec rotateX rotateY rotateZ rotatedEuler round same scale scaled select selfIntersecting shell shelled shells solids specific split splitted start strokeWidth style subType subtract subtracted surface sweep sweeped thicken thickened toData toEdge toFace toMeshEdges toMeshFaces toMeshShape toMeshVertices toString toSvg toTableData toWire twistExtrude twistExtruded type union unioned valid vertices visible volume wireType wires workPlaneNormal fromAll isShape

Constructors

Properties

CLASSNAME_TO_SHAPE_ENUM: {
    [key: string]: any;
} = {}

Type declaration

  • [key: string]: any
CLASSNAME_TO_SHAPE_ENUM_STATIC: {
    [key: string]: string;
} = ...

Type declaration

  • [key: string]: string
OC_SHAPE_ENUM_TO_CLASSNAME: {
    [key: string]: string;
} = {}

Type declaration

  • [key: string]: string
_geom: any
_isTmp: boolean = false
_obj: Obj
_oc: any
_ocId: string = null
_ocShape: any = null
_parent: Shape
annotations: DimensionLine[] = []
attributes: ShapeAttributes = {}

Methods

  • Check is a given string is a axis

    Parameters

    • axis: string

    Returns boolean

  • Parameters

    • ocWire: any
    • fix: boolean = true

    Returns Wire

  • Returns [number, number, number, number]

  • Parameters

    • ocShape: any
    • Optional type: string

    Returns any[]

  • We get unconnected Edges a lot ( because OC is somewhat loose with Edges in Wires ) This algorithm reconstructs a Collection of Array of Edges into a ordered (by number of Edges) Array of Wires

    Parameters

    Returns Edge[][]

  • Returns boolean

  • Create hash for this Shape: can be used to check if an Shape is the same instance (NOTE: not that is has equal geometry!)

    Returns string

  • Generate isometric view from Side or corner of ViewCube ('frontlefttop') or PointLike coordinate Use showHidden=true to output with hidden lines

    Parameters

    • viewpoint: PointLike
    • showHidden: boolean = false
    • transferDimensions: boolean = true

    Returns AnyShapeCollection

  • Make specific from general Shape

    Parameters

    • ocShape: any
    • type: string = null

    Returns any

  • Create mirrored copy relative to XZ plane with its center as pivot or given offset y-coord

    Parameters

    • Optional offset: number

    Returns AnyShape

  • Create mirrored copy relative to the YZ plane with its center as pivot or given offset x-coord

    Parameters

    • Optional offset: number

    Returns AnyShape

  • This returns the most specified subclass of Shape

    Returns any

  • Offset Wire to create a new parallel Wire at given distance (private) IMPORTANT: -amount means the Wire becomes smaller. We will check for that!

    Parameters

    • Optional amount: number
    • Optional type: string
    • Optional onPlaneNormal: PointLike

    Returns Wire

  • Project 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

    Parameters

    • Optional planeNormal: PointLike
    • Optional all: boolean

    Returns AnyShapeCollection

  • Returns type of Shape in Archiyou class name: Vertex, Edge, Wire, Face, Shell etc

    Parameters

    • i: any

    Returns any

  • Sweep a profile Wire or Face ( see Face.ts implementation: splitting inner and outerwires) along a path to create a Shell or Solid
    TODO: holes in profile from Face

    Parameters

    • path: LinearShape
    • Optional solid: boolean
    • Optional autoRotate: boolean
    • Optional alignToPath: Alignment

    Returns Face | Shell | Solid

  • Thicken (2D) Wire to create a thick Face (private: without adding to Scene) Compared to offset thickening creates a higher order Shape while offset keeps original Shape type

    Parameters

    • amount: number

      The total thickness added

    • Optional direction: ThickenDirection

      PointLike or Side (top,bottom,left,right,front,back)

    • Optional onPlaneNormal: PointLike

      Force the resulting Face to be on a specific plane given by its normal

    Returns Face

  • Return the first Edge (private))

    Returns any

  • Returns any

  • Extrude a Wire while rotating around the center with a given angle (private: without adding to Scene)

    Parameters

    • Optional amount: number
    • Optional angle: number
    • Optional pivot: PointLike
    • Optional direction: PointLike
    • Optional lefthand: boolean

    Returns Solid

  • Update properties from current OC Shape

    Parameters

    • Optional ocShape: any

    Returns void

  • Adds current Shape by wrapping it into an object and adding it either to root Obj (=scene) or adding

    Parameters

    • force: boolean = false

    Returns Shape

  • 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 !!!!

    Parameters

    Returns AnyShape

  • The top surface area of Shape - for example the area of a Box is the top part

    Returns number

  • Parameters

    • Optional key: string
    • Optional value: any

    Returns any

  • Check if Wire is continuous

    Returns boolean

  • Sometimes we get a certain Shape with only one subshape: like a Shell with only one Face, - A Wire with only one Edge - An Edge with only one Vertex Then downgrade and return a new Shape

    Returns AnyShape

  • Close this Wire by creating Edge from last Vertex to first

    Returns Wire

  • Check if a Wire is closed

    Returns boolean

  • Set color on the Object of this Shape

    Parameters

    • value: string | number

    Returns Wire

  • Extra algorithm to combine Edges into Wire - The OC WireBuilder does this mostly too - but this is triggered as last resort

    Parameters

    Returns Wire

  • Connect two Wires together into new one: introducing new line Edges distance is less than radius

    Parameters

    • other: Wire
    • Optional radius: number

    Returns Wire

  • For compatibility with ShapeCollection

    Returns number

  • Generic 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

    Parameters

    • Optional amount: number
    • Optional direction: PointLike

    Returns Edge | Face | Shell | Solid

  • Get the color of this Shape as defined in its Obj container

    Returns number

  • is this Shape 2D on XY plane (used for SVG export for example)

    Returns boolean

  • To have consistent API between Shape and ShapeCollection instances

    Parameters

    • obj: any

    Returns boolean

  • To have consistent API between Shape and ShapeCollection instances

    Returns boolean

  • Create a (righthand or lefthand) Helix with a radius, height and angle. Advanced coneSemiAngle (angle at top) for making a changing Helix radius (- for smaller to top)

    Parameters

    • Optional radius: number
    • Optional height: number
    • Optional angle: number
    • Optional pivot: PointLike
    • Optional direction: PointLike
    • Optional lefthand: boolean
    • Optional coneSemiAngle: number

    Returns Wire

  • Create flat Rectangular Wire

    Parameters

    • Optional width: number
    • Optional depth: number
    • Optional position: PointLike

    Returns Wire

  • Make 2D Spiral

    Parameters

    • firstRadius: number
    • secondRadius: number
    • angle: number
    • lefthand: boolean

    Returns Wire

  • Get max coordinate of Bbox of this Shape

    Parameters

    • axis: string

    Returns number

  • Get min coordinate of Bbox of this Shape

    Parameters

    • axis: string

    Returns number

  • Mirror Shape relative to XZ plane with its center as pivot or given offset y-coord

    Parameters

    • Optional offset: number

    Returns AnyShape

  • Mirror Shape relative to YZ plane with its center as pivot or given offset x-coord

    Parameters

    • Optional offset: number

    Returns AnyShape

  • Mirror Shape relative to XY plane with its center as pivot or given offset z-coord

    Parameters

    • Optional offset: number

    Returns AnyShape

  • Create mirrored copy relative to XY plane with its center as pivot and add to Scene

    Parameters

    • Optional offset: number

    Returns AnyShape

  • Aliass for move along x-direction

    Parameters

    • distance: number

    Returns Wire

  • Aliass for move along x-direction

    Parameters

    • distance: number

    Returns Wire

  • Aliass for move along x-direction

    Parameters

    • distance: number

    Returns Wire

  • Get normal of Face bounded by Wire NOTE: NormalAt gives on point on the Wire, normal that of the workplane

    Returns Vector

  • Return this Shape wrapped with a Obj instance for adding it to the scene

    Parameters

    • forceNew: boolean = false

    Returns Obj

  • Create a new version of current Wire that is parallel at a given distance

    Parameters

    • Optional amount: number
    • Optional type: string
    • Optional onPlaneNormal: PointLike

    Returns Wire

  • Offset Wire to create a new parallel Wire at given distance

    Parameters

    • Optional amount: number
    • Optional type: string
    • Optional onPlaneNormal: PointLike

    Returns Wire

  • Tests if two Shape overlap: meaning the two Shapes have at least on Vertex in common

    Parameters

    Returns boolean

  • Check if this Shape is parallel with the other - the specific meaning of this is different for each Shape Type

    Parameters

    • other: any

    Returns boolean

  • Check if Wire is coplanar

    Returns boolean

  • Get a Point at a certain percentage of the Wire

    Parameters

    • perc: number

    Returns Vector

  • Generate a Collection of a given number of Vertices equally spaces over this Wire including the start and end IMPORTANT: Parameters on a Wire are not homogenous with length units: We need a bit more advanced solution

    Parameters

    • Optional num: number

    Returns ShapeCollection

  • For now we don't have a sense of a pivot and thus clear position of an object, we calculate its center We can override this in the individual subclasses. TODO: For example an position of a Wire is probably more intuitive as its start Vertex

    Returns Point

  • Cast a 'Ray' (infinite Line) towards the Shape and Link information ( the hit point and support topography: Vertex, Edge, Face)

    Parameters

    Returns Link

  • We can delete a Shape from the Scene by removing it's Obj container

    Returns void

  • Rotate sequencely around the x,y and z axis. !!!! IMPORTANT: this is not the same as supplying the independant angles around the axis!

    Parameters

    Returns AnyShape

  • 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

    Parameters

    • degX: number
    • Optional degY: number
    • Optional degZ: number
    • Optional pivot: Pivot

    Returns AnyShape

  • Rotate Shape to place flat on XY plane. Keeps x,y position

    Parameters

    • Optional direction: "vertical" | "horizontal"
    • Optional autoRotate: boolean

    Returns AnyShape

  • Returns boolean

  • Returns subType of current Shape: For example Edge::Line

    Returns string

  • The total surface Area of a Shape - for example the total surface area of Sphere is 4Ï€r2

    Returns number

  • Sweep a profile Wire or Face ( see Face.ts implementation: splitting inner and outerwires) along a path to create a Shell or Solid

    Parameters

    • path: LinearShape
    • Optional solid: boolean
    • Optional autoRotate: boolean
    • Optional alignToPath: Alignment

    Returns Face | Shell | Solid

  • Return the first Edge (comes in handy when using Wire methods on single Edge Wire)

    Returns any

  • Export entity and minimal data as string (used for outputting on console and hashing )

    Returns string

  • Output all properties of this Obj including that of its Shapes into a { key value } row. This is where Calc gets its main data from

    Returns Object

  • Parameters

    • Optional amount: number
    • Optional angle: number
    • Optional pivot: PointLike
    • Optional direction: PointLike
    • Optional lefthand: boolean

    Returns Solid

  • Parameters

    • Optional amount: number
    • Optional angle: number
    • Optional pivot: PointLike
    • Optional direction: PointLike
    • Optional lefthand: boolean

    Returns Solid

  • Test if a Shape is valid

    Parameters

    • Optional ocShape: any

    Returns any

  • Return if the Shape Obj is set visible or not

    Returns boolean

  • Calculate the volume of this Shape

    Returns number

  • Get subtype of Wire, used for selecting

    Returns string

Generated using TypeDoc