opengeometry 2.0.11 → 2.0.14
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.
- package/analytic-worker.js +90 -0
- package/index.d.ts +16 -1
- package/index.js +3222 -3057
- package/index.js.map +1 -1
- package/opengeometry/pkg/opengeometry.d.ts +362 -224
- package/opengeometry/pkg/opengeometry.js +982 -298
- package/opengeometry/pkg/opengeometry_bg.wasm +0 -0
- package/opengeometry/pkg/opengeometry_bg.wasm.d.ts +251 -198
- package/opengeometry_bg.wasm +0 -0
- package/opengeometry_bg.wasm.d.ts +251 -198
- package/package.json +2 -1
- package/src/editor/types.d.ts +1 -1
- package/src/examples/booleans.d.ts +3 -2
- package/src/examples/editor-modes.d.ts +4 -8
- package/src/examples/index.d.ts +1 -0
- package/src/examples/offset-ring-variable.d.ts +13 -0
- package/src/examples/shapes.d.ts +1 -1
- package/src/examples/wall-from-offsets.d.ts +7 -14
- package/src/export/analytic-ifc.d.ts +61 -0
- package/src/freeform/geometry.d.ts +2 -0
- package/src/freeform/index.d.ts +1 -1
- package/src/operations/analytic-errors.d.ts +8 -0
- package/src/operations/boolean.d.ts +9 -141
- package/src/operations/index.d.ts +2 -4
- package/src/operations/loft.d.ts +13 -0
- package/src/operations/offset-regions.d.ts +36 -0
- package/src/primitives/analytic-curve.d.ts +42 -0
- package/src/primitives/arc.d.ts +26 -55
- package/src/primitives/elliptical_arc.d.ts +38 -0
- package/src/primitives/index.d.ts +1 -0
- package/src/rendering/analytic-lod.d.ts +32 -0
- package/src/rendering/analytic-tessellation.d.ts +32 -0
- package/src/shapes/analytic-pattern.d.ts +36 -0
- package/src/shapes/analytic-solid.d.ts +288 -0
- package/src/shapes/cuboid.d.ts +40 -54
- package/src/shapes/cylinder.d.ts +26 -70
- package/src/shapes/opening.d.ts +19 -82
- package/src/shapes/polygon.d.ts +4 -5
- package/src/shapes/solid.d.ts +0 -8
- package/src/shapes/sphere.d.ts +18 -73
- package/src/shapes/sweep.d.ts +0 -5
- package/src/shapes/wedge.d.ts +0 -5
- package/src/toolkit/index.d.ts +0 -4
- package/src/toolkit/wall.d.ts +0 -40
package/src/shapes/sphere.d.ts
CHANGED
|
@@ -1,82 +1,27 @@
|
|
|
1
|
-
import * as OGKernel from "../../opengeometry/pkg/opengeometry.js";
|
|
2
1
|
import { Vector3 } from "../../opengeometry/pkg/opengeometry.js";
|
|
3
2
|
import * as THREE from "three";
|
|
4
|
-
import {
|
|
5
|
-
import type { ShapeSubtractOperands, ShapeSubtractOptions, ShapeSubtractResult } from "./boolean-subtract.js";
|
|
6
|
-
/**
|
|
7
|
-
* Construction options for a sphere shape.
|
|
8
|
-
*/
|
|
3
|
+
import { AnalyticSolid, type AnalyticAccuracy } from "./analytic-solid.js";
|
|
9
4
|
export interface ISphereOptions {
|
|
5
|
+
ogid?: string;
|
|
6
|
+
center?: Vector3;
|
|
7
|
+
radius?: number;
|
|
8
|
+
deflection?: number;
|
|
9
|
+
accuracy?: AnalyticAccuracy;
|
|
10
|
+
color?: THREE.ColorRepresentation;
|
|
11
|
+
}
|
|
12
|
+
interface NormalizedSphereOptions {
|
|
10
13
|
ogid?: string;
|
|
11
14
|
center: Vector3;
|
|
12
15
|
radius: number;
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
color:
|
|
16
|
-
fatOutlines?: boolean;
|
|
17
|
-
outlineWidth?: number;
|
|
18
|
-
translation?: Vector3;
|
|
19
|
-
rotation?: Vector3;
|
|
20
|
-
scale?: Vector3;
|
|
21
|
-
}
|
|
22
|
-
/**
|
|
23
|
-
* Placement updates accepted by `Sphere`.
|
|
24
|
-
*/
|
|
25
|
-
export interface SpherePlacementOptions {
|
|
26
|
-
translation?: Vector3;
|
|
27
|
-
rotation?: Vector3;
|
|
28
|
-
scale?: Vector3;
|
|
16
|
+
deflection: number;
|
|
17
|
+
accuracy?: AnalyticAccuracy;
|
|
18
|
+
color: THREE.ColorRepresentation;
|
|
29
19
|
}
|
|
30
|
-
/**
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
export type SphereConfigUpdate = Partial<Omit<ISphereOptions, "translation" | "rotation" | "scale">>;
|
|
34
|
-
/**
|
|
35
|
-
* Alias for `Sphere` placement updates.
|
|
36
|
-
*/
|
|
37
|
-
export type SpherePlacementUpdate = SpherePlacementOptions;
|
|
38
|
-
/**
|
|
39
|
-
* Sphere wrapper backed by the kernel sphere primitive.
|
|
40
|
-
*/
|
|
41
|
-
export declare class Sphere extends THREE.Mesh {
|
|
42
|
-
#private;
|
|
43
|
-
ogid: string;
|
|
44
|
-
options: ISphereOptions;
|
|
45
|
-
private sphere;
|
|
46
|
-
private _outlineEnabled;
|
|
47
|
-
private _fatOutlines;
|
|
48
|
-
private _outlineWidth;
|
|
49
|
-
set radius(value: number);
|
|
50
|
-
set color(color: number);
|
|
20
|
+
/** Authoritative spherical BRep with explicit poles and transient deflection tessellation. */
|
|
21
|
+
export declare class Sphere extends AnalyticSolid {
|
|
22
|
+
readonly options: Readonly<NormalizedSphereOptions>;
|
|
51
23
|
constructor(options?: ISphereOptions);
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
getConfig(): ISphereOptions;
|
|
55
|
-
getAnchor(): OGKernel.Vector3;
|
|
56
|
-
setPlacement(placement: SpherePlacementUpdate): void;
|
|
57
|
-
setTransform(translation: Vector3, rotation: Vector3, scale: Vector3): void;
|
|
58
|
-
setTranslation(translation: Vector3): void;
|
|
59
|
-
setRotation(rotation: Vector3): void;
|
|
60
|
-
setScale(scale: Vector3): void;
|
|
61
|
-
getPlacement(): import("../editor.js").ParametricPlacement;
|
|
62
|
-
getEditCapabilities(): import("../editor.js").ParametricEditCapabilities;
|
|
63
|
-
canConvertToFreeform(): boolean;
|
|
64
|
-
toFreeform(id?: string): import("../freeform.js").FreeformGeometry;
|
|
65
|
-
cleanGeometry(): void;
|
|
66
|
-
generateGeometry(): void;
|
|
67
|
-
getBrep(): any;
|
|
68
|
-
/**
|
|
69
|
-
* Subtracts one or more boolean operands, such as Opening volumes, from this sphere.
|
|
70
|
-
*/
|
|
71
|
-
subtract(operands: ShapeSubtractOperands, options?: ShapeSubtractOptions): ShapeSubtractResult;
|
|
72
|
-
set outline(enable: boolean);
|
|
73
|
-
get outline(): boolean;
|
|
74
|
-
set fatOutlines(value: boolean);
|
|
75
|
-
get fatOutlines(): boolean;
|
|
76
|
-
set outlineWidth(value: number);
|
|
77
|
-
get outlineWidth(): number;
|
|
78
|
-
get outlineMesh(): ShapeOutlineMesh | null;
|
|
79
|
-
private clearOutlineMesh;
|
|
80
|
-
discardGeometry(): void;
|
|
81
|
-
private writePositionsToGeometry;
|
|
24
|
+
get radius(): number;
|
|
25
|
+
getAnchor(): THREE.Vector3;
|
|
82
26
|
}
|
|
27
|
+
export {};
|
package/src/shapes/sweep.d.ts
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import * as OGKernel from "../../opengeometry/pkg/opengeometry.js";
|
|
2
2
|
import { Vector3 } from "../../opengeometry/pkg/opengeometry.js";
|
|
3
3
|
import * as THREE from "three";
|
|
4
|
-
import type { ShapeSubtractOperands, ShapeSubtractOptions, ShapeSubtractResult } from "./boolean-subtract.js";
|
|
5
4
|
/**
|
|
6
5
|
* Construction options for a swept solid.
|
|
7
6
|
*/
|
|
@@ -65,10 +64,6 @@ export declare class Sweep extends THREE.Mesh {
|
|
|
65
64
|
cleanGeometry(): void;
|
|
66
65
|
generateGeometry(): void;
|
|
67
66
|
getBrep(): any;
|
|
68
|
-
/**
|
|
69
|
-
* Subtracts one or more boolean operands, such as Opening volumes, from this sweep.
|
|
70
|
-
*/
|
|
71
|
-
subtract(operands: ShapeSubtractOperands, options?: ShapeSubtractOptions): ShapeSubtractResult;
|
|
72
67
|
set outline(enable: boolean);
|
|
73
68
|
get outline(): boolean;
|
|
74
69
|
set fatOutlines(value: boolean);
|
package/src/shapes/wedge.d.ts
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { Vector3 } from "../../opengeometry/pkg/opengeometry.js";
|
|
2
2
|
import * as THREE from "three";
|
|
3
3
|
import { ShapeOutlineMesh } from "./outline-utils.js";
|
|
4
|
-
import type { ShapeSubtractOperands, ShapeSubtractOptions, ShapeSubtractResult } from "./boolean-subtract.js";
|
|
5
4
|
/**
|
|
6
5
|
* Construction options for a wedge/prism shape.
|
|
7
6
|
*/
|
|
@@ -63,10 +62,6 @@ export declare class Wedge extends THREE.Mesh {
|
|
|
63
62
|
cleanGeometry(): void;
|
|
64
63
|
generateGeometry(): void;
|
|
65
64
|
getBrepData(): any;
|
|
66
|
-
/**
|
|
67
|
-
* Subtracts one or more boolean operands, such as Opening volumes, from this wedge.
|
|
68
|
-
*/
|
|
69
|
-
subtract(operands: ShapeSubtractOperands, options?: ShapeSubtractOptions): ShapeSubtractResult;
|
|
70
65
|
set outline(enable: boolean);
|
|
71
66
|
get outline(): boolean;
|
|
72
67
|
set fatOutlines(value: boolean);
|
package/src/toolkit/index.d.ts
DELETED
package/src/toolkit/wall.d.ts
DELETED
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
/** A point of a returned wall footprint ring (kernel `Vector3` shape). */
|
|
2
|
-
export interface WallFootprintPoint {
|
|
3
|
-
x: number;
|
|
4
|
-
y: number;
|
|
5
|
-
z: number;
|
|
6
|
-
}
|
|
7
|
-
/** One footprint region: a CW outer ring + its CCW inner-void hole rings. */
|
|
8
|
-
export interface WallFootprintRegion {
|
|
9
|
-
/** Outer ring (CW, canonical start). */
|
|
10
|
-
outer: WallFootprintPoint[];
|
|
11
|
-
/** Inner-void hole rings (CCW), e.g. the room void of a closed wall. */
|
|
12
|
-
holes: WallFootprintPoint[][];
|
|
13
|
-
}
|
|
14
|
-
/**
|
|
15
|
-
* Build the base 2D wall footprint as one or more REGIONS from a centreline, via
|
|
16
|
-
* the deterministic analytic offset — miters / flat bevels at `miterLimit`,
|
|
17
|
-
* concave trims, and nonzero-winding resolution of reflex / closed loops. NO
|
|
18
|
-
* boolean union (so it is deterministic, unlike the 3D-mesh CSG path). Normal walls
|
|
19
|
-
* return one region; a self-crossing closed wall (e.g. a figure-8) returns one per
|
|
20
|
-
* simple sub-loop. Returns an EMPTY array for a genuinely unbuildable wall (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 miterLimit SVG stroke-miterlimit; corners sharper than this bevel. Default 4.
|
|
25
|
-
*/
|
|
26
|
-
export declare function buildWallFootprint(centrelineFlat: number[] | Float64Array, thickness: number, closed: boolean, miterLimit?: number): WallFootprintRegion[];
|
|
27
|
-
/** One wall in a junction group: centreline `[x,y,z, …]`, thickness, closed flag. */
|
|
28
|
-
export interface WallGroupMember {
|
|
29
|
-
centreline: number[];
|
|
30
|
-
thickness: number;
|
|
31
|
-
closed: boolean;
|
|
32
|
-
}
|
|
33
|
-
/**
|
|
34
|
-
* Merge a GROUP of separate walls (a cross-wall T / X / L junction) into one clean
|
|
35
|
-
* 2D footprint by nonzero-winding union of their mitered bands — the overlapping
|
|
36
|
-
* walls merge into a single region with mitered/bevelled corners, no internal edges.
|
|
37
|
-
* Returns CW-outer / CCW-hole regions (one or more); empty if nothing is buildable.
|
|
38
|
-
* No CSG. Used to render/extrude a junction as one joined mass in both views.
|
|
39
|
-
*/
|
|
40
|
-
export declare function buildWallGroupFootprint(walls: WallGroupMember[]): WallFootprintRegion[];
|