Hierarchy

Constructors

Properties

Methods

_addAnnotation _addDimensionsToProj _alignPerc _alignStringToAlignPerc _array1D _axisAndPlanesToVector _buildCurves _checkAxis _closestLinks _copy _copyAttributes _distanceAxis _distanceToShape _elevation _extractShapesFromOcCompound _firstVertex _flattened _fromOcCurve _fromOcEdge _fromOcShape _getColorRGBA _getEntities _getEntitiesDownFromType _getOBbox _getObjStyle _getOcShapesByType _getShapeTypeFromOcShape _getSide _getSideReal _getSvgClasses _getSvgPathAttributes _hashcode _intersections _intersectionsCommon _intersectionsSection _intersectionsWithEdge _isometry _lastVertex _makeSpecificOcShape _mirrored _mirroredX _mirroredY _mirroredZ _ocGeom _offsetted _pointAtPerc _project _reverseOcEdge _revolved _selectorAtAxisCoord _selectorClosestOrFurtherstTo _selectorClosestTo _selectorDistanceAlongAxis _selectorFurthestTo _selectorInBbox _selectorIndex _selectorNegativeOnAxis _selectorOfSubType _selectorOuterAlongAxis _selectorParallelTo _selectorPositiveOnAxis _selectorSide _selectorSmallestAlongAxis _selectorWithinRange _setShapeEnumToClassName _shapeCollectionFromOcCompound _shapeTypeEnumLookup _shelled _solidifyOperantFaces _splitted _subtracted _thickened _toOcCurve _toOcCurveHandle _toWire _unifyDomain _unioned _updateAnnotations _updateFromOcShape _updateOcShape add addToScene added align alignByPoints alignTo alignedByPoints angleTo area array arrayAlong arrayX arrayY arrayZ attribute attrs bbox capped center checkAndFix checkDowngrade checkObj close closest closestVertex color combine combined connected contains copy count dashed dimension direction directionAt directionAtEnd directionAtPerc directionAtStart directionMinMaxSelector distance distanceLink distanceVec distanceX distanceY distanceZ edgeType edges elevation end equals extend extended extrude extruded extrudedTo faces fromAll fuse fused getColor getCursor getId getName getParamAt getParamMinMax getSubShapes hide intersect intersected intersecting intersection intersections intersects is2D is2DXY isEmpty isShape isShapeCollection isVertex iso isometry length links loft lofted makeArc makeBezier makeCircle makeLine makeSpline max merge merged middle min mirrorX mirrorY mirrorZ mirrored mirroredX mirroredY mirroredZ move moveTo moveToOrigin moveX moveY moveZ moved movedTo name normal normalAt normalAtPerc obbox object ocGeom offset offsetted overlapping overlaps parallel 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 segmentize select shell shelled shells solids specific split splitted start strokeWidth style subType subtract subtracted surface sweeped tangent tangentAt thicken thickenOffsetted thickened toData toMeshEdges toMeshFaces toMeshShape toMeshVertices toString toSvg toTableData toVector toWire type union unioned valid vertices visible volume wires workPlaneNormal fromAll isShape

Constructors

  • Creates a simple Line Edge, use new Edge().makeCicle etc for others

    Parameters

    • Optional start: any
    • Optional end: any

    Returns Edge

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
TO_SVG_DASH_SIZE: number = 5
_geom: any
_isTmp: boolean = false
_obj: Obj
_oc: any
_ocId: string = null
_ocShape: any = null
_parent: Shape
annotations: DimensionLine[] = []
attributes: ShapeAttributes = {}

Methods

  • Needed to fix some Edges, for example after projecting

    Returns void

  • Check is a given string is a axis

    Parameters

    • axis: string

    Returns boolean

  • Create Edge from given OC Curve

    Parameters

    • ocCurve: any

      Geom_Curve

    Returns Edge

  • Returns [number, number, number, number]

  • Parameters

    • ocShape: any
    • Optional type: string

    Returns any[]

  • Based on attributes or tests add classes to Svg that help us select and style these SVG elements later

    Returns string

  • get SVG attributes from style properties of Shape

    Returns string

  • 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

  • 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

    Parameters

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

    Returns Edge | 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

  • Parameters

    • ocEdge: any

    Returns any

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

    Parameters

    • i: any

    Returns any

  • Returns any

  • 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

  • Calculate the angle between two touching Edges at either ends

    Parameters

    Returns number

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

  • Test if an Edge shares a Vertex with another

    Parameters

    Returns boolean

  • For compatibility with ShapeCollection

    Returns number

  • Get direction Vector of Line Edge from start to end

    Parameters

    • normalize: boolean = false

    Returns Vector

  • Get direction Vector at percentage of length

    Parameters

    • perc: any

    Returns Vector

  • Get Edge Type: Line, Circle, Ellipse, Hyperbola, Parabola, BezierCurve, BSplineCurve, OffsetCurve, OtherCurve IMPORTANT: Because it generates a lot of confusion we add here the distinction Circle/Arc that is not in OpenCascade

    Returns string

  • 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 parameter (U) on Edge for given Point. If not on Edge will pick closest

    Parameters

    Returns number

  • Getting U min and max of Curve IMPORTANT: For Line Curves the parameters are the same as the length For Arc Curves and Circles the U is the angle ( in radians ) - Half a circle: U = [0, PI] - Circle [0,PI*2]

    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 Circle Edge with given radius (default:50) and center (default: [0,0,0])

    Parameters

    • Optional radius: number
    • Optional center: PointLike

    Returns Edge

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

  • Aliass for move along x-direction

    Parameters

    • distance: number

    Returns Edge

  • Aliass for move along x-direction

    Parameters

    • distance: number

    Returns Edge

  • Calculate the normal of the straight line Edge Force that normal always faces flipTo (otherwise the side is determined by direction)

    Parameters

    • Optional orientTo: PointLike
    • Rest ...args: any[]

    Returns Vector

  • Get normal of Edge at percentage of length

    Parameters

    • perc: number

    Returns Vector

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

    Parameters

    • forceNew: boolean = false

    Returns Obj

  • Offset Edge a given amount into normal direction or reversed with '-amount'

    Parameters

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

    Returns Edge | Wire

  • Offset Edge a given amount into normal direction or reversed with '-amount' and return new Edge

    Parameters

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

    Returns Edge | Wire

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

    Parameters

    Returns boolean

  • Generate a Point at specific percentage of this Edge

    Parameters

    • perc: number

    Returns Point

  • Get Point at specific param value

    Parameters

    • param: number

    Returns Point

  • 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

  • Create a new Edge by reversing current one

    Returns Edge

  • 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

  • Break a curved Edge up into a Wire consisting of Line Edges with given angle between segments

    Parameters

    • Optional angle: number
    • Optional size: number

    Returns LinearShape

  • 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

  • Thicken the Edge along the normal to create a Face

    Parameters

    • Optional amount: number
    • Optional v: PointLike
    • Optional flip: boolean

    Returns Face

  • Thicken Edge to create a Face

    Parameters

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

    Returns Face

  • Minimal raw data of this Edge

    Returns number[][]

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

    Returns string

  • Export (segmentized) Edge (only X,Y coords) to SVG string

    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

Generated using TypeDoc