opengeometry 2.0.10 → 2.0.13

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,77 @@
1
+ /** A point of a returned offset region ring (kernel `Vector3` shape). */
2
+ export interface OffsetRegionPoint {
3
+ x: number;
4
+ y: number;
5
+ z: number;
6
+ }
7
+ /** One offset region: a CW outer ring + its CCW inner-void hole rings. */
8
+ export interface OffsetRegion {
9
+ /** Outer ring (CW, canonical start). */
10
+ outer: OffsetRegionPoint[];
11
+ /** Inner-void hole rings (CCW), e.g. the interior void of a closed loop. */
12
+ holes: OffsetRegionPoint[][];
13
+ }
14
+ /**
15
+ * Offset a centreline by ±half-width into one or more filled REGIONS, via the
16
+ * deterministic analytic offset — miters / flat bevels at `miterLimit`, concave
17
+ * trims, and nonzero-winding resolution of reflex / closed loops. NO boolean union
18
+ * (so it is deterministic, unlike the 3D-mesh CSG path). A simple centreline returns
19
+ * one region; a self-crossing closed centreline (e.g. a figure-8) returns one per
20
+ * simple sub-loop. Returns an EMPTY array for a genuinely unbuildable input (does
21
+ * not throw, so it never looks like a kernel crash). Rings are CW-outer / CCW-holes.
22
+ *
23
+ * @param centrelineFlat centreline points as `[x,y,z, …]`.
24
+ * @param width full stroke width (offset ±width/2 on each side).
25
+ * @param miterLimit SVG stroke-miterlimit; corners sharper than this bevel. Default 4.
26
+ */
27
+ export declare function offsetPolylineRegions(centrelineFlat: number[] | Float64Array, width: number, closed: boolean, miterLimit?: number): OffsetRegion[];
28
+ /** An excluded interior ring of a variable inset (an easement island, a
29
+ * protected tree pit): its closed ring `[x,y,z, …]` plus one clearance
30
+ * distance per hole edge. The inset GROWS the hole by its distances. */
31
+ export interface OffsetHole {
32
+ ring: number[] | Float64Array;
33
+ distances: number[] | Float64Array;
34
+ }
35
+ /**
36
+ * Inset a CLOSED ring inward with one distance per edge (edge i =
37
+ * `ring[i] → ring[i+1]`; an explicit closing duplicate point is accepted and
38
+ * stripped, the distance count stays one per unique edge). Built for setback
39
+ * envelopes: the result is the CLEARANCE-EXACT buildable region — the ring's
40
+ * interior minus every point within `distances[i]` of edge i's SEGMENT, so
41
+ * distant lot lines are honoured across notches and corners where distances
42
+ * differ become circumscribed clearance arcs (conservative). There is no
43
+ * `miterLimit` parameter, deliberately: miters and bevels only approximate the
44
+ * clearance arc, and a bevel would claim points inside the required distance.
45
+ *
46
+ * `holes` are excluded interior rings, each grown outward by its own per-edge
47
+ * distances — the region keeps clear of a hole's edges exactly as it keeps
48
+ * clear of the lot lines, so a hole can split the region or swallow it.
49
+ *
50
+ * Returns CW-outer / CCW-hole regions (canonical start vertex), possibly
51
+ * SEVERAL when a deep inset (or a hole) splits a waisted ring into disjoint
52
+ * lobes, and an EMPTY array when the inset collapses or the outer ring is
53
+ * degenerate (< 3 unique points, zero area, self-intersecting). THROWS on
54
+ * malformed arguments: a distance count that does not match an edge count, a
55
+ * negative / non-finite distance, or a degenerate hole — those are caller
56
+ * bugs, not geometry.
57
+ *
58
+ * @param ring closed ring points as `[x,y,z, …]` (Y is carried through).
59
+ * @param distances inward inset distance per edge, metres, each >= 0
60
+ * (0 = the edge stays in place, e.g. lot-line construction).
61
+ * @param holes excluded interior rings with their own per-edge distances.
62
+ */
63
+ export declare function offsetRingVariable(ring: number[] | Float64Array, distances: number[] | Float64Array, holes?: OffsetHole[]): OffsetRegion[];
64
+ /** One polyline in an offset group: centreline `[x,y,z, …]`, stroke width, closed flag. */
65
+ export interface OffsetPolyline {
66
+ centreline: number[];
67
+ width: number;
68
+ closed: boolean;
69
+ }
70
+ /**
71
+ * Merge a GROUP of separate polylines (a crossing T / X / L overlap) into one clean
72
+ * region by nonzero-winding union of their mitered bands — the overlapping strokes
73
+ * merge into a single region with mitered/bevelled corners, no internal edges.
74
+ * Returns CW-outer / CCW-hole regions (one or more); empty if nothing is buildable.
75
+ * No CSG. Used to render/extrude an overlapping crossing as one joined mass.
76
+ */
77
+ export declare function offsetPolylineGroupRegions(polylines: OffsetPolyline[]): OffsetRegion[];
@@ -0,0 +1,66 @@
1
+ import { Vector3 } from "../../opengeometry/pkg/opengeometry.js";
2
+ import * as THREE from "three";
3
+ /**
4
+ * Construction options for an elliptical arc primitive.
5
+ */
6
+ export interface IEllipticalArcOptions {
7
+ ogid?: string;
8
+ center: Vector3;
9
+ radiusX: number;
10
+ radiusZ: number;
11
+ startAngle: number;
12
+ endAngle: number;
13
+ segments: number;
14
+ color: number;
15
+ fatLines?: boolean;
16
+ width?: number;
17
+ translation?: Vector3;
18
+ rotation?: Vector3;
19
+ scale?: Vector3;
20
+ }
21
+ /**
22
+ * Placement updates accepted by `EllipticalArc`.
23
+ */
24
+ export interface EllipticalArcPlacementOptions {
25
+ translation?: Vector3;
26
+ rotation?: Vector3;
27
+ scale?: Vector3;
28
+ }
29
+ /**
30
+ * Partial config payload accepted by `EllipticalArc.setConfig(...)`.
31
+ */
32
+ export type EllipticalArcConfigUpdate = Partial<Omit<IEllipticalArcOptions, "translation" | "rotation" | "scale">>;
33
+ /**
34
+ * Alias for `EllipticalArc` placement updates.
35
+ */
36
+ export type EllipticalArcPlacementUpdate = EllipticalArcPlacementOptions;
37
+ /**
38
+ * EllipticalArc wrapper backed by the kernel OGEllipticalArc primitive.
39
+ */
40
+ export declare class EllipticalArc extends THREE.Line {
41
+ ogid: string;
42
+ options: IEllipticalArcOptions;
43
+ private ellipticalArc;
44
+ private fatLine;
45
+ set color(color: number);
46
+ constructor(options?: IEllipticalArcOptions);
47
+ validateOptions(): void;
48
+ setConfig(options: EllipticalArcConfigUpdate): void;
49
+ getAnchor(): Vector3;
50
+ setPlacement(placement: EllipticalArcPlacementUpdate): void;
51
+ setTransform(translation: Vector3, rotation: Vector3, scale: Vector3): void;
52
+ setTranslation(translation: Vector3): void;
53
+ setRotation(rotation: Vector3): void;
54
+ setScale(scale: Vector3): void;
55
+ getConfig(): IEllipticalArcOptions;
56
+ getPlacement(): import("../editor.js").ParametricPlacement;
57
+ getEditCapabilities(): import("../editor.js").ParametricEditCapabilities;
58
+ canConvertToFreeform(): boolean;
59
+ toFreeform(id?: string): import("../freeform.js").FreeformGeometry;
60
+ private getCurrentPositions;
61
+ private updateRenderStyle;
62
+ private generateGeometry;
63
+ getBrep(): any;
64
+ discardGeometry(): void;
65
+ private writePositionsToGeometry;
66
+ }
@@ -6,3 +6,4 @@ export * from './polyline.js';
6
6
  export * from './arc.js';
7
7
  export * from './rectangle.js';
8
8
  export * from './curve.js';
9
+ export * from "./elliptical_arc.js";
@@ -1,10 +0,0 @@
1
- /**
2
- * Chamfers (bevels) the specified edges of a BRep by a given distance.
3
- *
4
- * edgeIds: array of edge indices to chamfer (0-based, from brep.edges).
5
- * distance: retraction distance along each adjacent face.
6
- *
7
- * Returns a JSON-serialized BRep of the result.
8
- * Throws if the distance exceeds a face extent or an edge id is invalid.
9
- */
10
- export declare function chamferEdges(brepJson: string, edgeIds: number[], distance: number): string;
@@ -1,14 +0,0 @@
1
- /**
2
- * Applies a draft angle to the specified faces of a BRep.
3
- *
4
- * faceIds: array of face indices (0-based) to draft.
5
- * neutralPlaneNormal: normal of the neutral plane (pull direction).
6
- * angleRad: draft angle in radians (must be < π/2).
7
- *
8
- * Returns a JSON-serialized BRep of the result.
9
- */
10
- export declare function draftFaces(brepJson: string, faceIds: number[], neutralPlaneNormal: {
11
- x: number;
12
- y: number;
13
- z: number;
14
- }, angleRad: number): string;
@@ -1,13 +0,0 @@
1
- /**
2
- * Rounds (fillets) the specified edges of a closed solid BRep with a constant
3
- * radius. Each filleted edge becomes a curved tangent strip of radius `radius`.
4
- *
5
- * edgeIds: array of edge indices to fillet (0-based, from brep.edges).
6
- * radius: fillet radius in model units. Must be positive and less than the
7
- * inradius of both adjacent faces along the edge.
8
- * segments: angular resolution of the cylindrical cutter (default 16).
9
- *
10
- * Returns a JSON-serialized BRep of the result.
11
- * Throws if the radius exceeds the safe bound or an edge id is invalid.
12
- */
13
- export declare function filletEdges(brepJson: string, edgeIds: number[], radius: number, segments?: number): string;
@@ -1,16 +0,0 @@
1
- export interface LoftOptions {
2
- closed?: boolean;
3
- tolerance?: number;
4
- }
5
- /**
6
- * Lofts between N profiles with G0 (positional) continuity.
7
- *
8
- * Each profile is a flat array of xyz coordinates (3 floats per point).
9
- * All profiles must have the same vertex count.
10
- *
11
- * Returns a JSON-serialized BRep of the lofted solid.
12
- *
13
- * On failure the kernel throws a structured LoftError string. Handle it with
14
- * try/catch and inspect the message for the error variant.
15
- */
16
- export declare function loftProfiles(profiles: number[][], options?: LoftOptions): string;
@@ -1,21 +0,0 @@
1
- /**
2
- * Mirrors a BRep about a plane defined by an origin and a normal.
3
- *
4
- * planeOrigin: any point on the mirror plane.
5
- * planeNormal: unit normal of the mirror plane.
6
- * weld: if true, attempt to merge the original and mirrored BReps into a
7
- * single solid by stitching the parting faces.
8
- *
9
- * Returns a JSON-serialized BRep of the result.
10
- * Throws MirrorError::PlaneIntersectsSolid if weld=true and the plane
11
- * cuts through the interior.
12
- */
13
- export declare function mirrorAboutPlane(brepJson: string, planeOrigin: {
14
- x: number;
15
- y: number;
16
- z: number;
17
- }, planeNormal: {
18
- x: number;
19
- y: number;
20
- z: number;
21
- }, weld: boolean): string;
@@ -1,19 +0,0 @@
1
- /**
2
- * Creates a circular pattern of a BRep around an axis.
3
- *
4
- * axisOrigin: a point on the rotation axis.
5
- * axisDirection: unit vector along the rotation axis.
6
- * sweepRad: total angular span to distribute instances over (2*PI = full circle).
7
- * count: number of instances.
8
- *
9
- * Returns a JSON-serialized array of BReps (Vec<Brep>).
10
- */
11
- export declare function patternCircular(brepJson: string, axisOrigin: {
12
- x: number;
13
- y: number;
14
- z: number;
15
- }, axisDirection: {
16
- x: number;
17
- y: number;
18
- z: number;
19
- }, sweepRad: number, count: number): string;
@@ -1,15 +0,0 @@
1
- /**
2
- * Creates a linear pattern of a BRep along a direction vector.
3
- *
4
- * direction: step vector (does not need to be unit-length; its magnitude
5
- * sets the per-instance offset when combined with pitch).
6
- * pitch: spacing between instances along the direction vector.
7
- * count: number of instances to produce (including the original position).
8
- *
9
- * Returns a JSON-serialized array of BReps (Vec<Brep>).
10
- */
11
- export declare function patternLinear(brepJson: string, direction: {
12
- x: number;
13
- y: number;
14
- z: number;
15
- }, pitch: number, count: number): string;
@@ -1,17 +0,0 @@
1
- export interface PipeOptions {
2
- /** Number of segments around each circular cross-section (default 32). */
3
- segments?: number;
4
- }
5
- /**
6
- * Sweeps a circle along a 3D path, producing a pipe solid.
7
- *
8
- * `pathFlat` is a flat array of xyz coordinates: [x0,y0,z0, x1,y1,z1, …].
9
- * The path must contain at least 3 points.
10
- *
11
- * `radiusCurve` is either a single number (constant radius along the whole
12
- * path) or an array of numbers with the same length as the path point count
13
- * (variable radius — one value per station).
14
- *
15
- * Returns a JSON-serialised BRep of the pipe solid.
16
- */
17
- export declare function pipe(pathFlat: number[], radiusCurve: number | number[], options?: PipeOptions): string;
@@ -1,29 +0,0 @@
1
- export interface RevolveProfileOptions {
2
- axisOrigin?: {
3
- x: number;
4
- y: number;
5
- z: number;
6
- };
7
- axisDirection?: {
8
- x: number;
9
- y: number;
10
- z: number;
11
- };
12
- startAngleRad?: number;
13
- sweepAngleRad?: number;
14
- segments?: number;
15
- capStart?: boolean;
16
- capEnd?: boolean;
17
- tolerance?: number;
18
- }
19
- /**
20
- * Sweeps a planar generatrix profile around an axis by the given angle.
21
- *
22
- * The profile is a flat array of xyz coordinates (3 floats per point).
23
- * Returns a JSON-serialized BRep of the revolved surface.
24
- *
25
- * For full 2π sweeps, angular-seam caps are elided — the surface closes by
26
- * periodicity. Axis is defined by an origin point and a unit-length direction.
27
- * On-axis points generate triangle fans rather than degenerate quads.
28
- */
29
- export declare function revolveProfile(profileFlat: number[], options?: RevolveProfileOptions): string;
@@ -1,13 +0,0 @@
1
- export interface SweepOptions {
2
- capStart?: boolean;
3
- capEnd?: boolean;
4
- }
5
- /**
6
- * Sweeps a planar profile along a 3D path, producing a solid BRep.
7
- *
8
- * `pathFlat` is a flat array of xyz coordinates: [x0,y0,z0, x1,y1,z1, …].
9
- * `profileFlat` is a flat array of xyz coordinates for the cross-section.
10
- *
11
- * Returns a JSON-serialised BRep of the swept solid.
12
- */
13
- export declare function sweepProfileAlongPath(pathFlat: number[], profileFlat: number[], options?: SweepOptions): string;
@@ -1,31 +0,0 @@
1
- import { Vector3 } from "../../opengeometry/pkg/opengeometry.js";
2
- import * as THREE from "three";
3
- /**
4
- * Construction options for a helix path primitive.
5
- */
6
- export interface IHelixOptions {
7
- ogid?: string;
8
- axisOrigin: Vector3;
9
- axisDirection: Vector3;
10
- radius: number;
11
- pitch: number;
12
- turns: number;
13
- samplesPerTurn: number;
14
- color: number;
15
- }
16
- /**
17
- * Partial config payload accepted by `OGHelix.setConfig(...)`.
18
- */
19
- export type HelixConfigUpdate = Partial<IHelixOptions>;
20
- /**
21
- * Helix path primitive rendered as a Three.js line.
22
- */
23
- export declare class OGHelix extends THREE.Line {
24
- ogid: string;
25
- options: IHelixOptions;
26
- constructor(options?: Partial<IHelixOptions>);
27
- setConfig(options: HelixConfigUpdate): void;
28
- getConfig(): IHelixOptions;
29
- getSamples(): Vector3[];
30
- private generateGeometry;
31
- }
@@ -1,64 +0,0 @@
1
- import * as THREE from "three";
2
- import type { ShapeSubtractOperands, ShapeSubtractOptions, ShapeSubtractResult } from "./boolean-subtract.js";
3
- /**
4
- * Construction options for a cone shape.
5
- */
6
- export interface IConeOptions {
7
- ogid?: string;
8
- /** Apex position in world space. */
9
- apex: [number, number, number];
10
- /** Base centre position in world space. */
11
- baseCenter: [number, number, number];
12
- baseRadius: number;
13
- segments: number;
14
- /** Sweep angle in degrees (default 360). */
15
- angle: number;
16
- color: number;
17
- fatOutlines?: boolean;
18
- outlineWidth?: number;
19
- }
20
- /**
21
- * Partial config payload accepted by `Cone.setConfig(...)`.
22
- */
23
- export type ConeConfigUpdate = Partial<IConeOptions>;
24
- /**
25
- * Cone wrapper backed by the kernel `OGCone` revolve primitive.
26
- */
27
- export declare class Cone extends THREE.Mesh {
28
- #private;
29
- ogid: string;
30
- options: IConeOptions;
31
- private cone;
32
- private _outlineEnabled;
33
- private _fatOutlines;
34
- private _outlineWidth;
35
- set color(color: number);
36
- constructor(options?: Partial<IConeOptions>);
37
- setConfig(options: ConeConfigUpdate): void;
38
- getConfig(): IConeOptions;
39
- getEditCapabilities(): import("../editor.js").ParametricEditCapabilities;
40
- canConvertToFreeform(): boolean;
41
- toFreeform(id?: string): import("../freeform.js").FreeformGeometry;
42
- cleanGeometry(): void;
43
- generateGeometry(): void;
44
- getBrep(): any;
45
- /**
46
- * Subtracts one or more boolean operands from this cone.
47
- */
48
- subtract(operands: ShapeSubtractOperands, options?: ShapeSubtractOptions): ShapeSubtractResult;
49
- set outline(enable: boolean);
50
- get outline(): boolean;
51
- set fatOutlines(value: boolean);
52
- get fatOutlines(): boolean;
53
- set outlineWidth(value: number);
54
- get outlineWidth(): number;
55
- /** Sets position/rotation/scale placement. */
56
- setPlacement(placement: {
57
- translation?: THREE.Vector3Like;
58
- rotation?: THREE.Vector3Like;
59
- scale?: THREE.Vector3Like;
60
- }): void;
61
- private clearOutlineMesh;
62
- discardGeometry(): void;
63
- private writePositionsToGeometry;
64
- }
@@ -1,86 +0,0 @@
1
- import * as OGKernel from "../../opengeometry/pkg/opengeometry.js";
2
- import { Vector3 } from "../../opengeometry/pkg/opengeometry.js";
3
- import * as THREE from "three";
4
- import { ShapeOutlineMesh } from "./outline-utils.js";
5
- import type { ShapeSubtractOperands, ShapeSubtractOptions, ShapeSubtractResult } from "./boolean-subtract.js";
6
- /**
7
- * Construction options for an ellipsoid shape.
8
- */
9
- export interface IEllipsoidOptions {
10
- ogid?: string;
11
- center: Vector3;
12
- semiA: number;
13
- semiB: number;
14
- semiC: number;
15
- longitudeSegments: number;
16
- latitudeSegments: number;
17
- color: number;
18
- fatOutlines?: boolean;
19
- outlineWidth?: number;
20
- translation?: Vector3;
21
- rotation?: Vector3;
22
- scale?: Vector3;
23
- }
24
- /**
25
- * Placement updates accepted by `Ellipsoid`.
26
- */
27
- export interface EllipsoidPlacementOptions {
28
- translation?: Vector3;
29
- rotation?: Vector3;
30
- scale?: Vector3;
31
- }
32
- /**
33
- * Partial config payload accepted by `Ellipsoid.setConfig(...)`.
34
- */
35
- export type EllipsoidConfigUpdate = Partial<Omit<IEllipsoidOptions, "translation" | "rotation" | "scale">>;
36
- /**
37
- * Alias for `Ellipsoid` placement updates.
38
- */
39
- export type EllipsoidPlacementUpdate = EllipsoidPlacementOptions;
40
- /**
41
- * Ellipsoid wrapper backed by the kernel OGEllipsoid primitive.
42
- *
43
- * All three semi-axes (a, b, c) are independently configurable.
44
- * When a === b === c the shape degenerates to a sphere.
45
- */
46
- export declare class Ellipsoid extends THREE.Mesh {
47
- #private;
48
- ogid: string;
49
- options: IEllipsoidOptions;
50
- private ellipsoid;
51
- private _outlineEnabled;
52
- private _fatOutlines;
53
- private _outlineWidth;
54
- set color(color: number);
55
- constructor(options?: IEllipsoidOptions);
56
- validateOptions(): void;
57
- setConfig(options: EllipsoidConfigUpdate): void;
58
- getConfig(): IEllipsoidOptions;
59
- getAnchor(): OGKernel.Vector3;
60
- setPlacement(placement: EllipsoidPlacementUpdate): void;
61
- setTransform(translation: Vector3, rotation: Vector3, scale: Vector3): void;
62
- setTranslation(translation: Vector3): void;
63
- setRotation(rotation: Vector3): void;
64
- setScale(scale: Vector3): void;
65
- getPlacement(): import("../editor.js").ParametricPlacement;
66
- getEditCapabilities(): import("../editor.js").ParametricEditCapabilities;
67
- canConvertToFreeform(): boolean;
68
- toFreeform(id?: string): import("../freeform.js").FreeformGeometry;
69
- cleanGeometry(): void;
70
- generateGeometry(): void;
71
- getBrep(): any;
72
- /**
73
- * Subtracts one or more boolean operands, such as Opening volumes, from this ellipsoid.
74
- */
75
- subtract(operands: ShapeSubtractOperands, options?: ShapeSubtractOptions): ShapeSubtractResult;
76
- set outline(enable: boolean);
77
- get outline(): boolean;
78
- set fatOutlines(value: boolean);
79
- get fatOutlines(): boolean;
80
- set outlineWidth(value: number);
81
- get outlineWidth(): number;
82
- get outlineMesh(): ShapeOutlineMesh | null;
83
- private clearOutlineMesh;
84
- discardGeometry(): void;
85
- private writePositionsToGeometry;
86
- }
@@ -1,64 +0,0 @@
1
- import { Vector3 } from "../../opengeometry/pkg/opengeometry.js";
2
- import * as THREE from "three";
3
- import type { ShapeSubtractOperand, ShapeSubtractOptions, ShapeSubtractResult } from "./boolean-subtract.js";
4
- export interface IExtrusionOptions {
5
- ogid?: string;
6
- vertices: Vector3[];
7
- holes?: Vector3[][];
8
- height: number;
9
- color: number;
10
- fatOutlines?: boolean;
11
- outlineWidth?: number;
12
- translation?: Vector3;
13
- rotation?: Vector3;
14
- scale?: Vector3;
15
- }
16
- export interface ExtrusionPlacementOptions {
17
- translation?: Vector3;
18
- rotation?: Vector3;
19
- scale?: Vector3;
20
- }
21
- export type ExtrusionConfigUpdate = Partial<Omit<IExtrusionOptions, "translation" | "rotation" | "scale">>;
22
- export type ExtrusionPlacementUpdate = ExtrusionPlacementOptions;
23
- export declare class Extrusion extends THREE.Mesh {
24
- #private;
25
- ogid: string;
26
- options: IExtrusionOptions;
27
- private extrusion;
28
- private _outlineEnabled;
29
- private _fatOutlines;
30
- private _outlineWidth;
31
- private _outlineColor;
32
- set color(color: number);
33
- constructor(options?: IExtrusionOptions);
34
- validateOptions(): void;
35
- setConfig(options: ExtrusionConfigUpdate): void;
36
- getConfig(): IExtrusionOptions;
37
- getAnchor(): Vector3;
38
- setAnchor(anchor: Vector3): void;
39
- resetAnchor(): void;
40
- setPlacement(placement: ExtrusionPlacementUpdate): void;
41
- setTransform(translation: Vector3, rotation: Vector3, scale: Vector3): void;
42
- setTranslation(translation: Vector3): void;
43
- setRotation(rotation: Vector3): void;
44
- setScale(scale: Vector3): void;
45
- getPlacement(): import("../editor.js").ParametricPlacement;
46
- getEditCapabilities(): import("../editor.js").ParametricEditCapabilities;
47
- canConvertToFreeform(): boolean;
48
- toFreeform(id?: string): import("../freeform.js").FreeformGeometry;
49
- cleanGeometry(): void;
50
- generateGeometry(): void;
51
- getBrepData(): any;
52
- subtract(operand: ShapeSubtractOperand, options?: ShapeSubtractOptions): ShapeSubtractResult;
53
- set outlineColor(color: number);
54
- get outlineColor(): number;
55
- set outline(enable: boolean);
56
- get outline(): boolean;
57
- set fatOutlines(value: boolean);
58
- get fatOutlines(): boolean;
59
- set outlineWidth(value: number);
60
- get outlineWidth(): number;
61
- clearOutlineMesh(): void;
62
- discardGeometry(): void;
63
- private writePositionsToGeometry;
64
- }
@@ -1,44 +0,0 @@
1
- import * as THREE from "three";
2
- import type { ShapeSubtractOperands, ShapeSubtractOptions, ShapeSubtractResult } from "./boolean-subtract.js";
3
- /**
4
- * Construction options for a frustum (truncated cone) shape.
5
- */
6
- export interface IFrustumOptions {
7
- ogid?: string;
8
- baseCenter?: [number, number, number];
9
- baseRadius: number;
10
- topRadius: number;
11
- height: number;
12
- segments?: number;
13
- angle?: number;
14
- color: number;
15
- }
16
- /**
17
- * Placement updates accepted by `Frustum`.
18
- */
19
- export interface FrustumPlacementOptions {
20
- translation?: THREE.Vector3;
21
- rotation?: THREE.Vector3;
22
- scale?: THREE.Vector3;
23
- }
24
- /**
25
- * Partial config payload accepted by `Frustum.setConfig(...)`.
26
- */
27
- export type FrustumConfigUpdate = Partial<IFrustumOptions>;
28
- /**
29
- * Frustum (truncated cone) wrapper backed by the kernel OGFrustum primitive.
30
- */
31
- export declare class Frustum extends THREE.Mesh {
32
- ogid: string;
33
- options: Required<IFrustumOptions>;
34
- private frustum;
35
- constructor(options?: IFrustumOptions);
36
- setConfig(options: FrustumConfigUpdate): void;
37
- setPlacement(placement: FrustumPlacementOptions): void;
38
- getBrep(): any;
39
- /**
40
- * Subtracts one or more boolean operands from this frustum.
41
- */
42
- subtract(operands: ShapeSubtractOperands, options?: ShapeSubtractOptions): ShapeSubtractResult;
43
- private generateGeometry;
44
- }
@@ -1,44 +0,0 @@
1
- import * as THREE from "three";
2
- import type { ShapeSubtractOperands, ShapeSubtractOptions, ShapeSubtractResult } from "./boolean-subtract.js";
3
- /**
4
- * Construction options for a torus shape.
5
- */
6
- export interface ITorusOptions {
7
- ogid?: string;
8
- center?: [number, number, number];
9
- axis?: [number, number, number];
10
- majorRadius: number;
11
- minorRadius: number;
12
- majorSegments?: number;
13
- minorSegments?: number;
14
- color: number;
15
- }
16
- /**
17
- * Placement updates accepted by `Torus`.
18
- */
19
- export interface TorusPlacementOptions {
20
- translation?: THREE.Vector3;
21
- rotation?: THREE.Vector3;
22
- scale?: THREE.Vector3;
23
- }
24
- /**
25
- * Partial config payload accepted by `Torus.setConfig(...)`.
26
- */
27
- export type TorusConfigUpdate = Partial<ITorusOptions>;
28
- /**
29
- * Torus wrapper backed by the kernel OGTorus primitive.
30
- */
31
- export declare class Torus extends THREE.Mesh {
32
- ogid: string;
33
- options: Required<ITorusOptions>;
34
- private torus;
35
- constructor(options?: ITorusOptions);
36
- setConfig(options: TorusConfigUpdate): void;
37
- setPlacement(placement: TorusPlacementOptions): void;
38
- getBrep(): any;
39
- /**
40
- * Subtracts one or more boolean operands from this torus.
41
- */
42
- subtract(operands: ShapeSubtractOperands, options?: ShapeSubtractOptions): ShapeSubtractResult;
43
- private generateGeometry;
44
- }