Skip to main content

Class: _3DShape<Type>

Defined in: shapes.ts:1077

Extends

Extended by

Type Parameters

Type

Type extends TopoDS_Shape

Implements

Constructors

Constructor

new _3DShape<Type>(ocShape): _3DShape<Type>;

Defined in: shapes.ts:230

Parameters

ocShape

Type

Returns

_3DShape<Type>

Inherited from

Shape.constructor

Other

boundingBox

Get Signature

get boundingBox(): BoundingBox;

Defined in: shapes.ts:417

Returns

BoundingBox

Implementation of

Shape3DLike.boundingBox

Inherited from

Shape.boundingBox


edges

Get Signature

get edges(): Edge[];

Defined in: shapes.ts:405

Returns

Edge[]

Inherited from

Shape.edges


faces

Get Signature

get faces(): Face[];

Defined in: shapes.ts:409

Returns

Face[]

Inherited from

Shape.faces


hashCode

Get Signature

get hashCode(): number;

Defined in: shapes.ts:243

Returns

number

Inherited from

Shape.hashCode


isNull

Get Signature

get isNull(): boolean;

Defined in: shapes.ts:247

Returns

boolean

Inherited from

Shape.isNull


wires

Get Signature

get wires(): Wire[];

Defined in: shapes.ts:413

Returns

Wire[]

Inherited from

Shape.wires


wrapped

Get Signature

get wrapped(): Type;

Defined in: register.ts:39

Returns

Type

Set Signature

set wrapped(newWrapped): void;

Defined in: register.ts:44

Parameters
newWrapped

Type

Returns

void

Inherited from

Shape.wrapped


asShape3D()

asShape3D(): Shape3D;

Defined in: shapes.ts:266

Asserts that this shape is a 3D shape (Shell, Solid, CompSolid, or Compound) and returns it typed as Shape3D. Throws if the shape is not 3D.

Useful for chaining after operations that return a generic shape type.

Returns

Shape3D

Inherited from

Shape.asShape3D


clone()

clone(): this;

Defined in: shapes.ts:234

Returns

this

Inherited from

Shape.clone


delete()

delete(): void;

Defined in: register.ts:54

Returns

void

Inherited from

Shape.delete


isEqual()

isEqual(other): boolean;

Defined in: shapes.ts:255

Parameters

other

AnyShape

Returns

boolean

Inherited from

Shape.isEqual


isSame()

isSame(other): boolean;

Defined in: shapes.ts:251

Parameters

other

AnyShape

Returns

boolean

Inherited from

Shape.isSame


meshShape()

meshShape(options?): MeshShape;

Defined in: shapes.ts:1168

Parameters

options?
angularTolerance?

number

tolerance?

number

Returns

MeshShape


serialize()

serialize(): string;

Defined in: shapes.ts:238

Returns

string

Inherited from

Shape.serialize


simplify()

simplify(): this;

Defined in: shapes.ts:276

Simplifies the shape by removing unnecessary edges and faces

Returns

this

Inherited from

Shape.simplify

Shape Export

blobSTEP()

blobSTEP(): Blob;

Defined in: shapes.ts:593

Exports the current shape as a STEP file as a Blob

Returns

Blob

Inherited from

Shape.blobSTEP


blobSTL()

blobSTL(__namedParameters): Blob;

Defined in: shapes.ts:635

Exports the current shape as a STL file as a Blob

In order to create a STL file, the shape needs to be meshed. The tolerances correspond to the values used to mesh the shape.

Parameters

__namedParameters
angularTolerance?

number = 0.1

binary?

boolean = false

tolerance?

number = 1e-3

Returns

Blob

Inherited from

Shape.blobSTL


mesh()

mesh(__namedParameters): ShapeMesh;

Defined in: shapes.ts:439

Exports the current shape as a set of triangle. These can be used by threejs for instance to represent the the shape

Parameters

__namedParameters
angularTolerance?

number = 0.1

tolerance?

number = 1e-3

Returns

ShapeMesh

Implementation of

Shape3DLike.mesh

Inherited from

Shape.mesh


meshEdges()

meshEdges(__namedParameters): object;

Defined in: shapes.ts:476

Exports the current shape as a set of lines. These can be used by threejs for instance to represent the edges of the shape

Parameters

__namedParameters
angularTolerance?

number = 0.1

tolerance?

number = 1e-3

Returns

object

edgeGroups
edgeGroups: object[];
lines
lines: number[];

Inherited from

Shape.meshEdges

Shape Modifications

chamfer()

chamfer(radiusConfig, filter?): Shape3D;

Defined in: shapes.ts:1400

Creates a new shapes with some edges chamfered, as specified in the radius config.

If the radius is a filter finder object (with an EdgeFinder as filter, and a radius to specifiy the chamfer radius), the fillet will only be applied to the edges as selected by the finder. The finder will be deleted unless it is explicitly specified to keep it.

If the radius is a number all the edges will be chamfered.

If the radius is a function edges will be chamfered according to the value returned by the function (0 or null will not add any chamfer).

Parameters

radiusConfig

RadiusConfig<ChamferRadius>

filter?

(e) => EdgeFinder

Returns

Shape3D


cut()

cut(tool, __namedParameters): Shape3D;

Defined in: shapes.ts:1123

Builds a new shape by removing the tool tape from this shape

Parameters

tool

Shape3D

__namedParameters
optimisation?

"none" | "commonFace" | "sameFace" = "none"

Returns

Shape3D

Implementation of

Shape3DLike.cut


draft()

draft(
angle,
faceFinder,
neutralPlane): AnyShape;

Defined in: shapes.ts:1471

Applies a draft angle to selected faces of the shape.

A draft angle is a taper applied to faces, commonly used in moulding and casting to allow parts to be released from a mould. The selected faces are tilted by the given angle relative to the neutral plane.

The face finder function receives a FaceFinder and should return it with the desired filters applied to select which faces to draft.

The neutral plane defines the reference from which the draft angle is measured — faces are unchanged where they intersect this plane and taper away from it.

Parameters

angle

number

faceFinder

(e) => FaceFinder

neutralPlane

Plane | PlaneName

Returns

AnyShape


fillet()

fillet(radiusConfig, filter?): Shape3D;

Defined in: shapes.ts:1347

Creates a new shapes with some edges filletted, as specified in the radius config.

If the radius is a filter finder object (with an EdgeFinder as filter, and a radius to specifiy the fillet radius), the fillet will only be applied to the edges as selected by the finder. The finder will be deleted unless it is explicitly specified to keep it.

If the radius is a number all the edges will be filletted.

If the radius is a function edges will be filletted according to the value returned by the function (0 or null will not add any fillet).

Parameters

radiusConfig

RadiusConfig<FilletRadius>

filter?

(e) => EdgeFinder

Returns

Shape3D


fuse()

fuse(other, __namedParameters): Shape3D;

Defined in: shapes.ts:1092

Builds a new shape out of the two, fused, shapes

Parameters

other

Shape3D

__namedParameters
optimisation?

"none" | "commonFace" | "sameFace" = "none"

Returns

Shape3D

Implementation of

Shape3DLike.fuse


intersect()

intersect(tool): Shape3D;

Defined in: shapes.ts:1153

Builds a new shape by intersecting this shape and another

Parameters

tool

AnyShape

Returns

Shape3D

Implementation of

Shape3DLike.intersect


shell()

Call Signature

shell(config, tolerance?): Shape3D;

Defined in: shapes.ts:1220

Hollows out the current shape, removing the faces found by the filter and keeping a border of thickness

Parameters
config
filter

FaceFinder

thickness

number

tolerance?

number

Returns

Shape3D

Call Signature

shell(
thickness,
finderFcn,
tolerance?): Shape3D;

Defined in: shapes.ts:1224

Hollows out the current shape, removing the faces found by the filter and keeping a border of thickness

Parameters
thickness

number

finderFcn

(f) => FaceFinder

tolerance?

number

Returns

Shape3D

Shape Transformations

mirror()

mirror(inputPlane?, origin?): this;

Defined in: shapes.ts:368

Mirrors the shape through a plane

Parameters

inputPlane?

Point | Plane | PlaneName

origin?

Point

Returns

this

Implementation of

Shape3DLike.mirror

Inherited from

Shape.mirror


rotate()

rotate(
angle,
position,
direction): this;

Defined in: shapes.ts:349

Rotates the shape

Parameters

angle

number

position

Point = ...

direction

Point = ...

Returns

this

Implementation of

Shape3DLike.rotate

Inherited from

Shape.rotate


scale()

scale(scale, center): this;

Defined in: shapes.ts:384

Returns a scaled version of the shape

Parameters

scale

number

center

Point = ...

Returns

this

Implementation of

Shape3DLike.scale

Inherited from

Shape.scale


translate()

Call Signature

translate(
xDist,
yDist,
zDist): this;

Defined in: shapes.ts:300

Translates the shape of an arbitrary vector

Parameters
xDist

number

yDist

number

zDist

number

Returns

this

Implementation of

Shape3DLike.translate

Inherited from

Shape.translate

Call Signature

translate(vector): this;

Defined in: shapes.ts:301

Translates the shape of an arbitrary vector

Parameters
vector

Point

Returns

this

Implementation of

Shape3DLike.translate

Inherited from

Shape.translate


translateX()

translateX(distance): this;

Defined in: shapes.ts:322

Translates the shape on the X axis

Parameters

distance

number

Returns

this

Implementation of

Shape3DLike.translateX

Inherited from

Shape.translateX


translateY()

translateY(distance): this;

Defined in: shapes.ts:331

Translates the shape on the Y axis

Parameters

distance

number

Returns

this

Implementation of

Shape3DLike.translateY

Inherited from

Shape.translateY


translateZ()

translateZ(distance): this;

Defined in: shapes.ts:340

Translates the shape on the Z axis

Parameters

distance

number

Returns

this

Implementation of

Shape3DLike.translateZ

Inherited from

Shape.translateZ