Hierarchy

Constructors

Properties

Methods

_addAnnotation _addDimensionsToProj _alignPerc _alignStringToAlignPerc _array1D _axisAndPlanesToVector _checkAxis _closestLinks _copy _copyAttributes _distanceAxis _distanceToShape _elevation _extractShapesFromOcCompound _flattened _fromOcShape _getColorRGBA _getEntities _getEntitiesDownFromType _getOBbox _getObjStyle _getOcShapesByType _getShapeTypeFromOcShape _getSide _getSideReal _hashcode _intersections _intersectionsCommon _intersectionsSection _isometry _makeSpecificOcShape _mirrored _mirroredX _mirroredY _mirroredZ _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 _thickened _toWire _unifyDomain _unioned _updateAnnotations _updateFromOcShape _updateOcShape add addToScene added align alignByPoints alignedByPoints area array arrayAlong arrayX arrayY arrayZ attribute attrs bbox capped center checkAndFix checkDowngrade checkObj closest closestVertex color combine combined contains copy count dashed dimension directionMinMaxSelector distance distanceLink distanceVec distanceX distanceY distanceZ edges elevation equals extrude extruded extrudedTo faces fromAll 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 max merge merged min mirrorX mirrorY mirrorZ mirrored mirroredX mirroredY mirroredZ move moveTo moveToOrigin moveX moveY moveZ moved movedTo name obbox object ocGeom offset offsetted overlapping overlaps parallel pointAtSide populated position project raycast removeFromScene replaceShape revolved rotate rotateAround rotateEuler rotateToAxesBbox rotateToLayFlat rotateVecToVec rotateX rotateY rotateZ rotatedEuler round same scale scaled select shell shelled shells solids specific split splitted strokeWidth style subType subtract subtracted surface sweeped thicken thickened toData toMeshEdges toMeshFaces toMeshShape toMeshVertices toSvg toTableData toWire type union unioned valid vertices visible volume 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

  • Copy attributes from other Shape

    Parameters

    Returns void

  • Internal method that really calculates distance between two single Shapes

    Parameters

    Returns number

  • Returns [number, number, number, number]

  • Parameters

    • ocShape: any
    • Optional type: string

    Returns any[]

  • Parameters

    • ocShape: any

    Returns string

  • Getting Side sub shapes that clearly overlaps Side of bbox

    Parameters

    • sidesString: string

    Returns AnyShape

  • 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

    Parameters

    Returns Vertex | Edge | Wire | Face

  • 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

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

    Parameters

    • Optional offset: number

    Returns AnyShape

  • Offset Shape to create a new version parallel to original with a given distance and by corners of given type (arc, intersection)

    Parameters

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

    Returns AnyShapeOrCollection

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

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

    Parameters

    • i: any

    Returns any

  • Thicken a Shape depending on its type

    Parameters

    • amount: number
    • direction: string = 'all'

      all (grow from center), bottom, left, right, top

    Returns AnyShape

  • Returns void

  • Update properties from current OC Shape

    Parameters

    • Optional ocShape: any

    Returns void

  • Update _OcShape from Shape properties

    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

  • 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

    Parameters

    Returns Shape

  • 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

  • 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

  • Set color on the Object of this Shape

    Parameters

    • value: string | number

    Returns Shape

  • Copy the Shape and add it to the Scene

    Parameters

    • addToScene: boolean = true

    Returns AnyShape

  • For compatibility with ShapeCollection

    Returns number

  • Sorts objects by distance in a certain axis (X,Y,Z) and direcion (- or +)

    Parameters

    • shapes: AnyShapeCollection
    • axisAndDirection: string

      string with axis, direction and count: X, -Z - TODO num (unique results)[2]

    Returns Shape

  • 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

  • Get name of container Obj

    Returns string

  • Get name of container Obj

    Returns string

  • Get the Shapes that this Shape consists of

    For example: Wire => [ Edge, Edge, Edge ] Shell => [ Face, Face ]

    Parameters

    Returns Shape[]

  • is this Shape 2D

    Returns boolean

  • 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

  • Length of a Shape (depending on specific class)

    Returns number

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

  • Aliass for move along x-direction

    Parameters

    • distance: number

    Returns Shape

  • Aliass for move along x-direction

    Parameters

    • distance: number

    Returns Shape

  • Set name of container Obj

    Parameters

    • Optional newName: string

    Returns Shape

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

    Parameters

    • forceNew: boolean = false

    Returns Obj

  • Offset Shape to create a new version parallel to original with a given distance and by corners of given type (arc, intersection)

    Parameters

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

    Returns AnyShape

  • 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

  • Populate Shape (linear: Edge/Wire, planar: Face, Shell and solid) with Vertices Resulting Vertices include start and end Vertices

    Parameters

    • Optional num: number

    Returns AnyShapeCollection

  • 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

  • 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

    Parameters

    • Optional planeNormal: PointLike
    • Optional all: boolean

    Returns AnyShapeCollection

  • 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 so that its orientated bounding box is aligned with the axes

    Returns AnyShape

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

    Parameters

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

    Returns AnyShape

  • Rotate this Shape around the x-axis with a given angle and pivot (default: center)

    Parameters

    • deg: number
    • Optional pivot: Pivot

    Returns AnyShape

  • Rotate this Shape around the y-axis with a given angle and pivot (default: center)

    Parameters

    • deg: number
    • Optional pivot: Pivot

    Returns AnyShape

  • Rotate this Shape around the y-axis with a given angle and pivot (default: center)

    Parameters

    • deg: number
    • Optional pivot: Pivot

    Returns AnyShape

  • Same as rotateEuler but makes a copy

    Parameters

    • degX: number
    • degY: number = 0
    • degZ: number = 0
    • pivot: Pivot

    Returns AnyShape

  • Resize Shape with a given factor TODO: different scaling factors per axis? scale(0.5,1,2)

    Parameters

    • Optional factor: number
    • Optional pivot: PointLike

    Returns AnyShape

  • Sometimes we get a Shape instance - we can update that to the specific Shape class

    Returns AnyShape

  • Set stroke width of lines of Shape

    Parameters

    • n: number

    Returns Shape

  • 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

  • Create a new Shape by sweeping a the Shape's Wire representation through a Wire Path

    Parameters

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

    Returns Face | Shell | Solid

  • Parameters

    • amount: number
    • direction: string = 'all'

    Returns AnyShape

  • Thicken a Shape depending on its type

    Parameters

    • amount: number
    • direction: string = 'all'

      all (grow from center), bottom, left, right, top

    Returns AnyShape

  • Export 2D Shape to SVG

    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

  • 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

  • check if Shape is co-planar and return the normal of the workingplane if so!

    Returns Vector

  • Parameters

    • obj: any

    Returns any

Generated using TypeDoc