Skip to content

editorGlobalsPlate3DHelpers

Class: Plate3DHelpers

Helper methods for plate modifications that are three dimensional / affect the whole assembly

Hierarchy

  • Plate3DHelpers

Index

Properties

Methods

Properties

Static Private vector1

vector1: Vector3‹› = new Vector3()

Defined in src/model/data/PhysicalObject/Plate3DHelpers.ts:33


Static Private vector2

vector2: Vector3‹› = new Vector3()

Defined in src/model/data/PhysicalObject/Plate3DHelpers.ts:34

Methods

Static Private _determinePlateLocationRelativeToPlane

_determinePlateLocationRelativeToPlane(plate: Plate, plane: Plane): number

Defined in src/model/data/PhysicalObject/Plate3DHelpers.ts:930

Parameters:

Name Type
plate Plate
plane Plane

Returns: number


Static Private _subdivideIfPointIsOnSection

_subdivideIfPointIsOnSection(point3D: Vector3, section: OutlineSection): OutlinePoint‹›

Defined in src/model/data/PhysicalObject/Plate3DHelpers.ts:938

Parameters:

Name Type
point3D Vector3
section OutlineSection

Returns: OutlinePoint‹›


Static addCollinearOutlinePoints

addCollinearOutlinePoints(plate: Plate, otherPlates: Plate[]): OutlinePoint‹›[]

Defined in src/model/data/PhysicalObject/Plate3DHelpers.ts:433

Adds a collinear OutlinePoint to the outline of plate, when an OutlinePoint of one of otherPlates lies on the it.

Parameters:

Name Type Description
plate Plate Plate who's outline is edited
otherPlates Plate[] Plates to check with

Returns: OutlinePoint‹›[]

Created collinear outline points


Static containsPlate

containsPlate(containingPlate: Plate, containedPlate: Plate): boolean

Defined in src/model/data/PhysicalObject/Plate3DHelpers.ts:368

Returns true if contained plate is fully inside containingPlate (order sensitive!)

Parameters:

Name Type Description
containingPlate Plate bigger plate
containedPlate Plate smaller plate

Returns: boolean

Wheter containedPlate is a part of containingPlate


Static cutAssembly

cutAssembly(cutAssembly: Assembly, plane: Plane, fillPlateGaps: boolean): object

Defined in src/model/data/PhysicalObject/Plate3DHelpers.ts:80

Parameters:

Name Type Default
cutAssembly Assembly -
plane Plane -
fillPlateGaps boolean true

Returns: object


Static ensurePointOnPlatesEnd

ensurePointOnPlatesEnd(outlineSection: OutlineSection, assemblyPointOnSection: Vector3): OutlinePoint‹›

Defined in src/model/data/PhysicalObject/Plate3DHelpers.ts:515

see Plate3DHelpers.getPointOnPlatesEnd - same interface, but will create an OutlinePoint on the intersected section. returns the OutlinePoint of a section if the point was directly intersected.

Parameters:

Name Type Description
outlineSection OutlineSection -
assemblyPointOnSection Vector3 -

Returns: OutlinePoint‹›

The found or created OutlinePoint


Static getAllVertexPositionsInAssembly

getAllVertexPositionsInAssembly(assembly: Assembly): VertexPosition‹›[]

Defined in src/model/data/PhysicalObject/Plate3DHelpers.ts:774

Returns all VertexPositions referenced from this assembly.

Parameters:

Name Type Description
assembly Assembly -

Returns: VertexPosition‹›[]


Static getCurvedSections

getCurvedSections(plate: Plate): OutlineSpline‹›[]

Defined in src/model/data/PhysicalObject/Plate3DHelpers.ts:740

Parameters:

Name Type Description
plate Plate Plate to be checked

Returns: OutlineSpline‹›[]

Sections that are curved


Static getInnerPlateAngle

getInnerPlateAngle(plateA: Plate, plateB: Plate): number

Defined in src/model/data/PhysicalObject/Plate3DHelpers.ts:539

This method takes two plates and does its best to get to a meaningful angle between two plates. Correctness can not be guaranteed for all cases (holes and concave plates are problematic).

Parameters:

Name Type Description
plateA Plate -
plateB Plate -

Returns: number

The inner (smaller) angle between the two plates in radians


Static getInnerPlateAngleAtEdgeJoint

getInnerPlateAngleAtEdgeJoint(edgeJoint: EdgeJoint): number

Defined in src/model/data/PhysicalObject/Plate3DHelpers.ts:592

This method is similar to Plate3DHelpers.getInnerPlateAngle, but it is more stable as it does not need to guess. It knows that two plates are joined with an EdgeJoint and simply takes the section normals to find out the angle.

Parameters:

Name Type
edgeJoint EdgeJoint

Returns: number

The angle between the two plates at edgeJoint


Static getInsidePointingNormalsForJoint

getInsidePointingNormalsForJoint(plate: Plate, otherPlate: Plate, joint: EdgeJoint): Vector3

Defined in src/model/data/PhysicalObject/Plate3DHelpers.ts:581

Will return the two plate normals in either negated or non-negated way, such that if a line was created from each plate in direction of each plates normal, the returned vectors would point towards the intersection of the two lines.

(The arrow would be the returned normal for the top plate) ---------------X | / | / | / | / V /

It will always consider the smaller angle of the two, i.e. jointAngle will be in [0, 180[.

Parameters:

Name Type
plate Plate
otherPlate Plate
joint EdgeJoint

Returns: Vector3


Static getIntersectionLineSegments

getIntersectionLineSegments(intersectionPointsPerPlate: Vector3[][]): Array‹[Vector3, Vector3]›

Defined in src/model/data/PhysicalObject/Plate3DHelpers.ts:793

Creates an array of start-end pairs from an array of intersectionPoints. It cleans up floating point mistakes on the given intersectionPoints. It orders the intersectionPoints on each plate

Parameters:

Name Type Description
intersectionPointsPerPlate Vector3[][] -

Returns: Array‹[Vector3, Vector3]›


Static getOutlinesFromIntersectionCyclesOfOutlines

getOutlinesFromIntersectionCyclesOfOutlines(originalPlane: Plane, plates: Outline3D[], reverse: boolean): Outline[]

Defined in src/model/data/PhysicalObject/Plate3DHelpers.ts:811

Parameters:

Name Type Default
originalPlane Plane -
plates Outline3D[] -
reverse boolean false

Returns: Outline[]


Static getOutlinesFromIntersectionCyclesOfPlane

getOutlinesFromIntersectionCyclesOfPlane(originalPlane: Plane, plates: Plate[]): Outline[]

Defined in src/model/data/PhysicalObject/Plate3DHelpers.ts:879

Parameters:

Name Type
originalPlane Plane
plates Plate[]

Returns: Outline[]


Static getPlateIntersection

getPlateIntersection(plateA: Plate, plateB: Plate): [boolean, Vector3, Vector3, Vector3, Vector3]

Defined in src/model/data/PhysicalObject/Plate3DHelpers.ts:50

calculates the intersection line of the two planes first checks whether planes are connected at all returns the outer intersection points of the line and the outlines of the two planes

Parameters:

Name Type
plateA Plate
plateB Plate

Returns: [boolean, Vector3, Vector3, Vector3, Vector3]

whether the plates are connected, and then the intersection points sorted along the intersection line, e.g.

-----------X-----------------O-----------------X----------------------O--------- leftA leftB rightA rightB

(one plate may completely be embedded into the other, see also the usage in CrossJointRenderer)

ToDo: Test


Static getPointOnExtrudedPlatesEnd

getPointOnExtrudedPlatesEnd(outlineSection: OutlineSection, assemblyPointOnSection: Vector3): object | object

Defined in src/model/data/PhysicalObject/Plate3DHelpers.ts:498

Given an OutlineSection and a point on it, returns the point that is on the other side of the joined plate, extruded orthogonally to the section's direction

see Plate3DHelpers.getPointOnPlatesEnd for parameters

Parameters:

Name Type
outlineSection OutlineSection
assemblyPointOnSection Vector3

Returns: object | object


Static getPointOnPlatesEnd

getPointOnPlatesEnd(outlineSection: OutlineSection, assemblyPointOnSection: Vector3): object | object

Defined in src/model/data/PhysicalObject/Plate3DHelpers.ts:306

Given an OutlineSection and a point on it, returns the point that is on the other side of the same plate (directed orthogonally to the section's direction)

Parameters:

Name Type Description
outlineSection OutlineSection -
assemblyPointOnSection Vector3 -

Returns: object | object

type='intersection': the OutlineSection on the other end plus the intersection point in assembly coords type='outlinePoint': the OutlineSection and intersected outlinePoint ToDo: Test


Static getSectionsJoinedWithCurves

getSectionsJoinedWithCurves(plate: Plate): BendSection[]

Defined in src/model/data/PhysicalObject/Plate3DHelpers.ts:732

Parameters:

Name Type Description
plate Plate Plate to be checked

Returns: BendSection[]

Sections that are joined with curves


Static getSharedPoints

getSharedPoints(plate: Plate, otherPlate: Plate): OutlinePoint‹›[]

Defined in src/model/data/PhysicalObject/Plate3DHelpers.ts:483

Parameters:

Name Type
plate Plate
otherPlate Plate

Returns: OutlinePoint‹›[]


Static getUnjoinedCurvedSections

getUnjoinedCurvedSections(plate: Plate): OutlineSection‹›[]

Defined in src/model/data/PhysicalObject/Plate3DHelpers.ts:758

Parameters:

Name Type Description
plate Plate Plate to be checked

Returns: OutlineSection‹›[]

Curved sections that are unjoined


Static isBentPlate

isBentPlate(plate: Plate): boolean

Defined in src/model/data/PhysicalObject/Plate3DHelpers.ts:467

Parameters:

Name Type Description
plate Plate Plate to be checked

Returns: boolean

Whether the given plate is a bent plate


Static isConvex

isConvex(sectionA: OutlineSection, sectionB: OutlineSection): boolean

Defined in src/model/data/PhysicalObject/Plate3DHelpers.ts:684

Parameters:

Name Type Description
sectionA OutlineSection -
sectionB OutlineSection -

Returns: boolean

Whether the two (joined) sections form a convex edge. For this definition of convex it is assumed, that the plate normals point outwards


Static isEdgeJointConvex

isEdgeJointConvex(edgeJoint: EdgeJoint): boolean

Defined in src/model/data/PhysicalObject/Plate3DHelpers.ts:674

Parameters:

Name Type Description
edgeJoint EdgeJoint -

Returns: boolean

Whether the two sections of this joint form a convex edge. @see Plate3DHelpers.isConvex


Static isEdgeJointCoplanar

isEdgeJointCoplanar(edgeJoint: EdgeJoint): boolean

Defined in src/model/data/PhysicalObject/Plate3DHelpers.ts:690

Parameters:

Name Type
edgeJoint EdgeJoint

Returns: boolean


Static isOneDimensionallyBent

isOneDimensionallyBent(plate: Plate): boolean

Defined in src/model/data/PhysicalObject/Plate3DHelpers.ts:699

Parameters:

Name Type Description
plate Plate Plate to be checked

Returns: boolean

Whether the given plate is supported by other plate


Static isSectionCurved

isSectionCurved(section: OutlineSection): boolean

Defined in src/model/data/PhysicalObject/Plate3DHelpers.ts:471

Parameters:

Name Type
section OutlineSection

Returns: boolean


Static isSectionJoinedWithCurve

isSectionJoinedWithCurve(section: OutlineSection): boolean

Defined in src/model/data/PhysicalObject/Plate3DHelpers.ts:750

Parameters:

Name Type Description
section OutlineSection -

Returns: boolean

Whether the given section is joined with a curve


Static isSectionUnjoined

isSectionUnjoined(section: OutlineSection): boolean

Defined in src/model/data/PhysicalObject/Plate3DHelpers.ts:479

Parameters:

Name Type Description
section OutlineSection Section to be checked

Returns: boolean

Whether the given section is unjoined


Static plateFrom3DPositions

plateFrom3DPositions(assembly: Assembly, outlinePoints: Vector3[], addJoints: boolean, holeOutlinePoints: Vector3[][]): Plate‹›

Defined in src/model/data/PhysicalObject/Plate3DHelpers.ts:266

This creates a new plate with the provided positions (in assembly space) and adds it to the assembly.

Parameters:

Name Type Default Description
assembly Assembly - Assembly to add plate to.
outlinePoints Vector3[] - Point positions in assembly space and CCW.
addJoints boolean true Whether to add FingerJoints. Defaults to true.
holeOutlinePoints Vector3[][] [] Point positions to create holes for this plate, in assembly coordinates and CW.

Returns: Plate‹›


Static replaceOutlineSectionWithBend

replaceOutlineSectionWithBend(section: OutlineSection, equalityDistance: number, plate?: Plate): Plate‹›

Defined in src/model/data/PhysicalObject/Plate3DHelpers.ts:152

Parameters:

Name Type Description
section OutlineSection -
equalityDistance number Created or moved points on each sections end will have at least a distance greater than 1.001 times this to each other (to avoid accidental merging).
plate? Plate -

Returns: Plate‹›


Static Private splitOutlinePointsInDifferentAssemblies

splitOutlinePointsInDifferentAssemblies(assembly: Assembly): void

Defined in src/model/data/PhysicalObject/Plate3DHelpers.ts:911

It may happen, that outlinePoints are merged with other outlinePoints, which are not part of the same assembly. This method splits the affected vertexPositions and then merges the correct outlinePoints back together.

Parameters:

Name Type
assembly Assembly

Returns: void


Static subdivideCollinearSections

subdivideCollinearSections(sectionA: OutlineSection, sectionB: OutlineSection): boolean

Defined in src/model/data/PhysicalObject/Plate3DHelpers.ts:622

Adds subdivisions to collinear OutlineSections in order to allow for edge joints to be created.

Parameters:

Name Type Description
sectionA OutlineSection -
sectionB OutlineSection -

Returns: boolean


Static subdivideCollinearSectionsOfPhysicalObjects

subdivideCollinearSectionsOfPhysicalObjects(objectA: PhysicalObject, objectB: PhysicalObject): void

Defined in src/model/data/PhysicalObject/Plate3DHelpers.ts:599

Parameters:

Name Type
objectA PhysicalObject
objectB PhysicalObject

Returns: void


Static traversePlatesAroundOutlinePoint

traversePlatesAroundOutlinePoint(outlinePoint: OutlinePoint, section: OutlineSection, callback: function, mergedPoints?: OutlinePoint[]): "closedLoop" | "aborted" | "openLoop"

Defined in src/model/data/PhysicalObject/Plate3DHelpers.ts:393

Traverses all plates that share the given OutlinePoint (VertexPosition)

Parameters:

outlinePoint: OutlinePoint

OutlinePoint to traverse around

section: OutlineSection

A section adjacent to outlinePoint indicating the traversal direction outlinePoint has two adjacent sections. You may start traversing from the current plate to the neighboring plate at either of those sections.

callback: function

Will be invoked with plate, outlinePoint and edgeJoint as arguments. If this function returns true, traversal will stop.

▸ (currentPlate: Plate, currentOutlinePoint: OutlinePoint, edgeJoint: EdgeJoint): boolean

Parameters:

Name Type
currentPlate Plate
currentOutlinePoint OutlinePoint
edgeJoint EdgeJoint

Optional mergedPoints: OutlinePoint[]

Merged vertices of outlinePoint (useful if they're currently unmerged)

Returns: "closedLoop" | "aborted" | "openLoop"

'closedLoop' if traversal was stopped by going full circle 'aborted' if the callback returned true 'openLoop' otherwise, i.e. if there were no more neighboring plates in traversal direction