Skip to main content

Class: CompSolid

Defined in: packages/replicad/src/shapes.ts:937

Extends

Constructors

Constructor

new CompSolid(ocShape): CompSolid;

Defined in: packages/replicad/src/shapes.ts:189

Parameters

ocShape

TopoDS_CompSolid

Returns

CompSolid

Inherited from

_3DShape.constructor

Other

boundingBox

Get Signature

get boundingBox(): BoundingBox;

Defined in: packages/replicad/src/shapes.ts:408

Returns

BoundingBox

Inherited from

_3DShape.boundingBox


edges

Get Signature

get edges(): Edge[];

Defined in: packages/replicad/src/shapes.ts:389

Returns

Edge[]

Inherited from

_3DShape.edges


faces

Get Signature

get faces(): Face[];

Defined in: packages/replicad/src/shapes.ts:393

Returns

Face[]

Inherited from

_3DShape.faces


hashCode

Get Signature

get hashCode(): number;

Defined in: packages/replicad/src/shapes.ts:201

Returns

number

Inherited from

_3DShape.hashCode


isNull

Get Signature

get isNull(): boolean;

Defined in: packages/replicad/src/shapes.ts:205

Returns

boolean

Inherited from

_3DShape.isNull


solids

Get Signature

get solids(): Solid[];

Defined in: packages/replicad/src/shapes.ts:397

Returns

Solid[]

Inherited from

_3DShape.solids


wires

Get Signature

get wires(): Wire[];

Defined in: packages/replicad/src/shapes.ts:404

Returns

Wire[]

Inherited from

_3DShape.wires


wrapped

Get Signature

get wrapped(): Type;

Defined in: packages/replicad/src/register.ts:41

Returns

Type

Set Signature

set wrapped(newWrapped): void;

Defined in: packages/replicad/src/register.ts:46

Parameters
newWrapped

Type

Returns

void

Inherited from

_3DShape.wrapped


[dispose]()

dispose: void;

Defined in: node_modules/typescript/lib/lib.esnext.disposable.d.ts:36

Returns

void

Inherited from

_3DShape.[dispose]


asShape3D()

asShape3D(): Shape3D;

Defined in: packages/replicad/src/shapes.ts:260

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

_3DShape.asShape3D


clone()

clone(): this;

Defined in: packages/replicad/src/shapes.ts:193

Returns

this

Inherited from

_3DShape.clone


delete()

delete(): void;

Defined in: packages/replicad/src/register.ts:58

Returns

void

Inherited from

_3DShape.delete


isEqual()

isEqual(other): boolean;

Defined in: packages/replicad/src/shapes.ts:213

Parameters

other

AnyShape

Returns

boolean

Inherited from

_3DShape.isEqual


isSame()

isSame(other): boolean;

Defined in: packages/replicad/src/shapes.ts:209

Parameters

other

AnyShape

Returns

boolean

Inherited from

_3DShape.isSame


meshShape()

meshShape(options?): MeshShape;

Defined in: packages/replicad/src/shapes.ts:703

Parameters

options?
angularTolerance?

number

tolerance?

number

Returns

MeshShape

Inherited from

_3DShape.meshShape


serialize()

serialize(): string;

Defined in: packages/replicad/src/shapes.ts:197

Returns

string

Inherited from

_3DShape.serialize


simplify()

simplify(): this;

Defined in: packages/replicad/src/shapes.ts:270

Simplifies the shape by removing unnecessary edges and faces

Returns

this

Inherited from

_3DShape.simplify

Shape Export

blobSTEP()

blobSTEP(): Blob;

Defined in: packages/replicad/src/shapes.ts:439

Exports the current shape as a STEP file as a Blob

Returns

Blob

Inherited from

_3DShape.blobSTEP


blobSTL()

blobSTL(options?): Blob;

Defined in: packages/replicad/src/shapes.ts:451

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

options?

STLExportOptions = {}

Returns

Blob

Inherited from

_3DShape.blobSTL


mesh()

mesh(options?): ShapeMesh;

Defined in: packages/replicad/src/shapes.ts:420

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

Parameters

options?

MeshOptions = {}

Returns

ShapeMesh

Inherited from

_3DShape.mesh


meshEdges()

meshEdges(options?): ShapeEdgeMesh;

Defined in: packages/replicad/src/shapes.ts:430

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

options?

MeshOptions = {}

Returns

ShapeEdgeMesh

Inherited from

_3DShape.meshEdges

Shape Modifications

chamfer()

chamfer(radiusConfig, filter?): Shape3D;

Defined in: packages/replicad/src/shapes.ts:859

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?

FinderFunction<EdgeFinder, AnyShape>

Returns

Shape3D

Inherited from

_3DShape.chamfer


cut()

cut(tool, options?): Shape3D;

Defined in: packages/replicad/src/shapes.ts:663

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

Parameters

tool

Shape3D

options?

BooleanOperationOptions = {}

Returns

Shape3D

Inherited from

_3DShape.cut


cutPlane()

cutPlane(
plane?,
offset?,
keep?): Solid | Compound | null;

Defined in: packages/replicad/src/shapes.ts:687

Cuts this shape with a plane and retains one of its half-spaces. Positive is the direction of the plane normal and is kept by default.

Parameters

plane?

Plane | PlaneName

offset?

number = 0

keep?

PlaneSide = "positive"

Returns

Solid | Compound | null

Inherited from

_3DShape.cutPlane


draft()

draft(
angle,
faceFinder,
neutralPlane?): Shape3D;

Defined in: packages/replicad/src/shapes.ts:921

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

FinderFunction<FaceFinder, AnyShape>

neutralPlane?

Plane | PlaneName

Returns

Shape3D

Inherited from

_3DShape.draft


fillet()

fillet(radiusConfig, filter?): Shape3D;

Defined in: packages/replicad/src/shapes.ts:820

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?

FinderFunction<EdgeFinder, AnyShape>

Returns

Shape3D

Inherited from

_3DShape.fillet


fuse()

fuse(other, options?): Shape3D;

Defined in: packages/replicad/src/shapes.ts:652

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

Parameters

other

Shape3D

options?

BooleanOperationOptions = {}

Returns

Shape3D

Inherited from

_3DShape.fuse


intersect()

intersect(tool): Shape3D;

Defined in: packages/replicad/src/shapes.ts:674

Builds a new shape by intersecting this shape and another

Parameters

tool

AnyShape

Returns

Shape3D

Inherited from

_3DShape.intersect


shell()

Call Signature

shell(config, tolerance?): Shape3D;

Defined in: packages/replicad/src/shapes.ts:755

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

Inherited from

_3DShape.shell

Call Signature

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

Defined in: packages/replicad/src/shapes.ts:759

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

Parameters
thickness

number

finderFcn

FinderFunction<FaceFinder, AnyShape>

tolerance?

number

Returns

Shape3D

Inherited from

_3DShape.shell


split()

split(
plane?,
offset?,
tolerance?): PlaneSplitResult<Solid | Compound>;

Defined in: packages/replicad/src/shapes.ts:228

Splits the solid parts of this shape with an oriented plane and groups them by side. Non-solid results are ignored.

offset translates the splitting plane along its normal. Each side is null when empty, the resulting shape when it contains one piece, or a Compound when it contains multiple disconnected pieces. Positive is the direction of the plane's normal.

Parameters

plane?

Plane | PlaneName

offset?

number = 0

tolerance?

number = 1e-7

Returns

PlaneSplitResult<Solid | Compound>

Inherited from

_3DShape.split

Shape Transformations

mirror()

mirror(inputPlane?, origin?): this;

Defined in: packages/replicad/src/shapes.ts:362

Mirrors the shape through a plane

Parameters

inputPlane?

| Point | Plane | PlaneName

origin?

Point

Returns

this

Inherited from

_3DShape.mirror


rotate()

rotate(
angle,
position?,
direction?): this;

Defined in: packages/replicad/src/shapes.ts:343

Rotates the shape

Parameters

angle

number

position?

Point = ...

direction?

Direction = ...

Returns

this

Inherited from

_3DShape.rotate


scale()

scale(scale, center?): this;

Defined in: packages/replicad/src/shapes.ts:378

Returns a scaled version of the shape

Parameters

scale

number

center?

Point = ...

Returns

this

Inherited from

_3DShape.scale


translate()

Call Signature

translate(
xDist,
yDist,
zDist): this;

Defined in: packages/replicad/src/shapes.ts:294

Translates the shape of an arbitrary vector

Parameters
xDist

number

yDist

number

zDist

number

Returns

this

Inherited from

_3DShape.translate

Call Signature

translate(vector): this;

Defined in: packages/replicad/src/shapes.ts:295

Translates the shape of an arbitrary vector

Parameters
vector

Point

Returns

this

Inherited from

_3DShape.translate


translateX()

translateX(distance): this;

Defined in: packages/replicad/src/shapes.ts:316

Translates the shape on the X axis

Parameters

distance

number

Returns

this

Inherited from

_3DShape.translateX


translateY()

translateY(distance): this;

Defined in: packages/replicad/src/shapes.ts:325

Translates the shape on the Y axis

Parameters

distance

number

Returns

this

Inherited from

_3DShape.translateY


translateZ()

translateZ(distance): this;

Defined in: packages/replicad/src/shapes.ts:334

Translates the shape on the Z axis

Parameters

distance

number

Returns

this

Inherited from

_3DShape.translateZ