opengeometry 2.0.18 → 3.0.0
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/LICENSE.md +373 -0
- package/README.md +187 -128
- package/body-registry-MbAD6Hyq.js +3159 -0
- package/body-registry-MbAD6Hyq.js.map +1 -0
- package/index.d.ts +18 -115
- package/index.js +1170 -11758
- package/index.js.map +1 -1
- package/opengeometry/pkg/opengeometry.d.ts +144 -1304
- package/opengeometry/pkg/opengeometry.js +1316 -5806
- package/opengeometry/pkg/opengeometry_bg.wasm +0 -0
- package/opengeometry/pkg/opengeometry_bg.wasm.d.ts +62 -458
- package/opengeometry_bg.wasm +0 -0
- package/opengeometry_bg.wasm.d.ts +62 -458
- package/package.json +54 -34
- package/src/bodies/body-factory.d.ts +3 -0
- package/src/bodies/body-options.d.ts +19 -0
- package/src/bodies/body-placement.d.ts +10 -0
- package/src/bodies/body-registry.d.ts +3 -0
- package/src/bodies/body.d.ts +71 -0
- package/src/bodies/display-clone.d.ts +10 -0
- package/src/bodies/node-methods.d.ts +30 -0
- package/src/bodies/sheet.d.ts +14 -0
- package/src/bodies/solid.d.ts +23 -0
- package/src/bodies/system-assembly.d.ts +26 -0
- package/src/bodies/wire.d.ts +14 -0
- package/src/constants/index.d.ts +4 -0
- package/src/constants/operations.d.ts +58 -0
- package/src/constants/primitives.d.ts +69 -0
- package/src/constants/regions.d.ts +1 -0
- package/src/constants/transforms.d.ts +4 -0
- package/src/dto/boolean-report.d.ts +24 -0
- package/src/dto/bounds.d.ts +1 -0
- package/src/dto/brep.d.ts +99 -0
- package/src/dto/change-set.d.ts +13 -0
- package/src/dto/creation.d.ts +3 -0
- package/src/dto/display-buffers.d.ts +14 -0
- package/src/dto/events.d.ts +2 -0
- package/src/{export/analytic-ifc.d.ts → dto/ifc-body.d.ts} +16 -18
- package/src/dto/mark-stats.d.ts +4 -0
- package/src/dto/measure.d.ts +16 -0
- package/src/dto/mirror.d.ts +4 -0
- package/src/dto/node-info.d.ts +11 -0
- package/src/dto/pick-result.d.ts +6 -0
- package/src/dto/placement.d.ts +6 -0
- package/src/dto/primitives.d.ts +77 -0
- package/src/dto/regions.d.ts +42 -0
- package/src/dto/step-export.d.ts +42 -0
- package/src/errors.d.ts +20 -0
- package/src/export/export-step.d.ts +10 -0
- package/src/export/ifc-body.d.ts +4 -0
- package/src/kernel/kernel-errors.d.ts +5 -0
- package/src/kernel/kernel-loader.d.ts +5 -0
- package/src/kernel/kernel-session.d.ts +2 -0
- package/src/limits.d.ts +12 -0
- package/src/marks/limbo.d.ts +6 -0
- package/src/marks/og-mark.d.ts +10 -0
- package/src/marks/transaction.d.ts +3 -0
- package/src/opengeometry.d.ts +69 -0
- package/src/operations/offsets.d.ts +5 -0
- package/src/operations/regions.d.ts +4 -0
- package/src/picking/pick-targets.d.ts +6 -0
- package/src/picking/resolve-hit.d.ts +3 -0
- package/src/rendering/deferred.d.ts +7 -0
- package/src/rendering/geometry/geometry-scheduler.d.ts +12 -0
- package/src/rendering/geometry/host-group.d.ts +10 -0
- package/src/rendering/geometry/render-pass.d.ts +8 -0
- package/src/rendering/geometry/settle.d.ts +10 -0
- package/src/rendering/inline-backend.d.ts +14 -0
- package/src/rendering/lod/body-size.d.ts +11 -0
- package/src/rendering/lod/camera-observer.d.ts +2 -0
- package/src/rendering/lod/deflection.d.ts +2 -0
- package/src/rendering/lod/display-bounds.d.ts +4 -0
- package/src/rendering/lod/displayed.d.ts +7 -0
- package/src/rendering/lod/host-drawn.d.ts +5 -0
- package/src/rendering/lod/host-groups.d.ts +28 -0
- package/src/rendering/lod/lod-controller.d.ts +75 -0
- package/src/rendering/lod/screen-metrics.d.ts +2 -0
- package/src/rendering/materials/material-pool.d.ts +12 -0
- package/src/rendering/materials/ref-counted-pool.d.ts +12 -0
- package/src/rendering/provider.d.ts +19 -0
- package/src/rendering/records/geometry-record.d.ts +21 -0
- package/src/rendering/records/record-pool.d.ts +29 -0
- package/src/rendering/records/validate-display-buffers.d.ts +2 -0
- package/src/rendering/tessellation-worker.d.ts +1 -0
- package/src/rendering/worker/job-queue.d.ts +8 -0
- package/src/rendering/worker/message-guards.d.ts +9 -0
- package/src/rendering/worker/snapshot-cache.d.ts +10 -0
- package/src/rendering/worker-backend.d.ts +44 -0
- package/src/rendering/worker-protocol.d.ts +52 -0
- package/src/runtime/create-runtime.d.ts +7 -0
- package/src/runtime/event-bus.d.ts +3 -0
- package/src/runtime/reset.d.ts +1 -0
- package/src/runtime/runtime-state.d.ts +68 -0
- package/src/testing/internals.d.ts +18 -0
- package/src/world-graph/codec.d.ts +45 -0
- package/src/world-graph/world-graph-client.d.ts +13 -0
- package/tessellation-worker.js +634 -0
- package/tessellation-worker.js.map +1 -0
- package/testing.d.ts +1 -0
- package/testing.js +87 -0
- package/testing.js.map +1 -0
- package/analytic-worker.js +0 -90
- package/src/base-types.d.ts +0 -13
- package/src/editor/freeform.d.ts +0 -91
- package/src/editor/index.d.ts +0 -6
- package/src/editor/parametric.d.ts +0 -15
- package/src/editor/types.d.ts +0 -223
- package/src/examples/booleans.d.ts +0 -24
- package/src/examples/editor-modes.d.ts +0 -20
- package/src/examples/index.d.ts +0 -11
- package/src/examples/offset-ring-variable.d.ts +0 -13
- package/src/examples/offset.d.ts +0 -18
- package/src/examples/primitives.d.ts +0 -16
- package/src/examples/ribbon-from-offsets.d.ts +0 -33
- package/src/examples/shapes.d.ts +0 -20
- package/src/examples/sweep.d.ts +0 -9
- package/src/freeform/geometry.d.ts +0 -82
- package/src/freeform/index.d.ts +0 -5
- package/src/freeform/types.d.ts +0 -36
- package/src/markup/spotMarker.d.ts +0 -4
- package/src/operations/analytic-errors.d.ts +0 -8
- package/src/operations/boolean-regions.d.ts +0 -20
- package/src/operations/boolean.d.ts +0 -16
- package/src/operations/editor/freeform.d.ts +0 -1
- package/src/operations/editor/index.d.ts +0 -1
- package/src/operations/editor/parametric.d.ts +0 -1
- package/src/operations/editor/types.d.ts +0 -1
- package/src/operations/extrude.d.ts +0 -9
- package/src/operations/index.d.ts +0 -9
- package/src/operations/loft.d.ts +0 -13
- package/src/operations/offset-regions.d.ts +0 -76
- package/src/primitives/analytic-curve.d.ts +0 -42
- package/src/primitives/arc.d.ts +0 -36
- package/src/primitives/curve.d.ts +0 -64
- package/src/primitives/elliptical_arc.d.ts +0 -38
- package/src/primitives/index.d.ts +0 -9
- package/src/primitives/line.d.ts +0 -77
- package/src/primitives/polyline.d.ts +0 -78
- package/src/primitives/rectangle.d.ts +0 -72
- package/src/rendering/analytic-lod.d.ts +0 -32
- package/src/rendering/analytic-tessellation.d.ts +0 -32
- package/src/shapes/analytic-pattern.d.ts +0 -36
- package/src/shapes/analytic-solid.d.ts +0 -304
- package/src/shapes/cuboid.d.ts +0 -62
- package/src/shapes/cylinder.d.ts +0 -36
- package/src/shapes/index.d.ts +0 -11
- package/src/shapes/opening.d.ts +0 -31
- package/src/shapes/outline-utils.d.ts +0 -35
- package/src/shapes/polygon.d.ts +0 -102
- package/src/shapes/solid.d.ts +0 -108
- package/src/shapes/sphere.d.ts +0 -27
- package/src/shapes/sweep.d.ts +0 -76
- package/src/shapes/wedge.d.ts +0 -75
- package/src/utils/event.d.ts +0 -29
- package/src/utils/randomizer.d.ts +0 -1
- package/src/world/world-graph.d.ts +0 -112
|
@@ -1,76 +0,0 @@
|
|
|
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 collapsed 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. Its closed ring has one
|
|
29
|
-
* clearance distance per edge; the inset grows the hole by those distances. */
|
|
30
|
-
export interface OffsetHole {
|
|
31
|
-
ring: number[] | Float64Array;
|
|
32
|
-
distances: number[] | Float64Array;
|
|
33
|
-
}
|
|
34
|
-
/**
|
|
35
|
-
* Inset a CLOSED ring inward with one distance per edge (edge i =
|
|
36
|
-
* `ring[i] → ring[i+1]`; an explicit closing duplicate point is accepted and
|
|
37
|
-
* stripped, the distance count stays one per unique edge). The result is a
|
|
38
|
-
* clearance-exact inset region: the ring's interior minus every point within
|
|
39
|
-
* `distances[i]` of edge i's segment. Distant boundary segments remain
|
|
40
|
-
* effective across notches; different distances produce circumscribed
|
|
41
|
-
* clearance arcs. There is no
|
|
42
|
-
* `miterLimit` parameter, deliberately: miters and bevels only approximate the
|
|
43
|
-
* clearance arc, and a bevel would claim points inside the required distance.
|
|
44
|
-
*
|
|
45
|
-
* `holes` are excluded interior rings, each grown outward by its own per-edge
|
|
46
|
-
* distances — the region keeps clear of a hole's edges exactly as it keeps
|
|
47
|
-
* clear of the outer boundary, so a hole can split the region or swallow it.
|
|
48
|
-
*
|
|
49
|
-
* Returns CW-outer / CCW-hole regions (canonical start vertex), possibly
|
|
50
|
-
* SEVERAL when a deep inset (or a hole) splits a waisted ring into disjoint
|
|
51
|
-
* lobes, and an EMPTY array when the inset collapses or the outer ring is
|
|
52
|
-
* degenerate (< 3 unique points, zero area, self-intersecting). THROWS on
|
|
53
|
-
* malformed arguments: a distance count that does not match an edge count, a
|
|
54
|
-
* negative / non-finite distance, or a degenerate hole — those are caller
|
|
55
|
-
* bugs, not geometry.
|
|
56
|
-
*
|
|
57
|
-
* @param ring closed ring points as `[x,y,z, …]` (Y is carried through).
|
|
58
|
-
* @param distances inward inset distance per edge, metres, each >= 0
|
|
59
|
-
* (0 keeps that boundary edge in place).
|
|
60
|
-
* @param holes excluded interior rings with their own per-edge distances.
|
|
61
|
-
*/
|
|
62
|
-
export declare function offsetRingVariable(ring: number[] | Float64Array, distances: number[] | Float64Array, holes?: OffsetHole[]): OffsetRegion[];
|
|
63
|
-
/** One polyline in an offset group: centreline `[x,y,z, …]`, stroke width, closed flag. */
|
|
64
|
-
export interface OffsetPolyline {
|
|
65
|
-
centreline: number[];
|
|
66
|
-
width: number;
|
|
67
|
-
closed: boolean;
|
|
68
|
-
}
|
|
69
|
-
/**
|
|
70
|
-
* Merge a GROUP of separate polylines (a crossing T / X / L overlap) into one clean
|
|
71
|
-
* region by nonzero-winding union of their mitered bands — the overlapping strokes
|
|
72
|
-
* merge into a single region with mitered/bevelled corners, no internal edges.
|
|
73
|
-
* Returns CW-outer / CCW-hole regions (one or more); empty if no region remains.
|
|
74
|
-
* No CSG. Used to render/extrude an overlapping crossing as one joined mass.
|
|
75
|
-
*/
|
|
76
|
-
export declare function offsetPolylineGroupRegions(polylines: OffsetPolyline[]): OffsetRegion[];
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
import * as THREE from "three";
|
|
2
|
-
import { OGAnalyticBrep } from "../../opengeometry/pkg/opengeometry.js";
|
|
3
|
-
import type { AnalyticAccuracy, AnalyticFrame } from "../shapes/analytic-solid.js";
|
|
4
|
-
export type AnalyticCurveOptions = {
|
|
5
|
-
ogid?: string;
|
|
6
|
-
frame?: AnalyticFrame;
|
|
7
|
-
accuracy?: AnalyticAccuracy;
|
|
8
|
-
startAngle: number;
|
|
9
|
-
sweepAngle: number;
|
|
10
|
-
deflection?: number;
|
|
11
|
-
color?: THREE.ColorRepresentation;
|
|
12
|
-
} & ({
|
|
13
|
-
kind: "arc";
|
|
14
|
-
radius: number;
|
|
15
|
-
} | {
|
|
16
|
-
kind: "ellipticalArc";
|
|
17
|
-
majorRadius: number;
|
|
18
|
-
minorRadius: number;
|
|
19
|
-
});
|
|
20
|
-
export interface AnalyticCurveStats {
|
|
21
|
-
requestedDeflection: number;
|
|
22
|
-
achievedDeflection: number;
|
|
23
|
-
segmentCount: number;
|
|
24
|
-
revision: bigint;
|
|
25
|
-
}
|
|
26
|
-
export declare class AnalyticCurve extends THREE.Group {
|
|
27
|
-
readonly ogid: string;
|
|
28
|
-
readonly line: THREE.LineSegments<THREE.BufferGeometry, THREE.LineBasicMaterial>;
|
|
29
|
-
protected kernel: OGAnalyticBrep;
|
|
30
|
-
private segmentEdges;
|
|
31
|
-
private disposed;
|
|
32
|
-
get color(): THREE.Color;
|
|
33
|
-
set color(value: THREE.ColorRepresentation);
|
|
34
|
-
constructor(options: AnalyticCurveOptions);
|
|
35
|
-
getBrepSerialized(): string;
|
|
36
|
-
getBrepData(): Record<string, unknown>;
|
|
37
|
-
protected replaceDefinition(options: AnalyticCurveOptions): AnalyticCurveStats;
|
|
38
|
-
edgeIdForSegment(segment: number): number | undefined;
|
|
39
|
-
retessellate(deflection: number): AnalyticCurveStats;
|
|
40
|
-
dispose(): void;
|
|
41
|
-
private checkActive;
|
|
42
|
-
}
|
package/src/primitives/arc.d.ts
DELETED
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import * as THREE from "three";
|
|
2
|
-
import { Vector3 } from "../../opengeometry/pkg/opengeometry.js";
|
|
3
|
-
import { AnalyticCurve, type AnalyticCurveStats } from "./analytic-curve.js";
|
|
4
|
-
import type { AnalyticAccuracy } from "../shapes/analytic-solid.js";
|
|
5
|
-
export interface IArcOptions {
|
|
6
|
-
ogid?: string;
|
|
7
|
-
center?: Vector3;
|
|
8
|
-
radius?: number;
|
|
9
|
-
startAngle?: number;
|
|
10
|
-
sweepAngle?: number;
|
|
11
|
-
deflection?: number;
|
|
12
|
-
accuracy?: AnalyticAccuracy;
|
|
13
|
-
color?: THREE.ColorRepresentation;
|
|
14
|
-
}
|
|
15
|
-
export type ArcConfigUpdate = Partial<Omit<IArcOptions, "ogid">>;
|
|
16
|
-
interface NormalizedArcOptions {
|
|
17
|
-
ogid?: string;
|
|
18
|
-
center: Vector3;
|
|
19
|
-
radius: number;
|
|
20
|
-
startAngle: number;
|
|
21
|
-
sweepAngle: number;
|
|
22
|
-
deflection: number;
|
|
23
|
-
accuracy?: AnalyticAccuracy;
|
|
24
|
-
color: THREE.ColorRepresentation;
|
|
25
|
-
}
|
|
26
|
-
/** Authoritative circular edge with transient deflection tessellation. */
|
|
27
|
-
export declare class Arc extends AnalyticCurve {
|
|
28
|
-
options: Readonly<NormalizedArcOptions>;
|
|
29
|
-
constructor(options?: IArcOptions);
|
|
30
|
-
getAnchor(): Vector3;
|
|
31
|
-
getConfig(): Readonly<NormalizedArcOptions>;
|
|
32
|
-
setConfig(update: ArcConfigUpdate): AnalyticCurveStats;
|
|
33
|
-
getBrep(): Record<string, unknown>;
|
|
34
|
-
retessellate(deflection: number): AnalyticCurveStats;
|
|
35
|
-
}
|
|
36
|
-
export {};
|
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
import * as THREE from "three";
|
|
2
|
-
import { Vector3 } from "../../opengeometry/pkg/opengeometry.js";
|
|
3
|
-
/**
|
|
4
|
-
* Construction options for a control-point-driven curve.
|
|
5
|
-
*/
|
|
6
|
-
export interface ICurveOptions {
|
|
7
|
-
ogid?: string;
|
|
8
|
-
controlPoints: Vector3[];
|
|
9
|
-
color: number;
|
|
10
|
-
translation?: Vector3;
|
|
11
|
-
rotation?: Vector3;
|
|
12
|
-
scale?: Vector3;
|
|
13
|
-
}
|
|
14
|
-
/**
|
|
15
|
-
* Placement updates accepted by `Curve`.
|
|
16
|
-
*/
|
|
17
|
-
export interface CurvePlacementOptions {
|
|
18
|
-
translation?: Vector3;
|
|
19
|
-
rotation?: Vector3;
|
|
20
|
-
scale?: Vector3;
|
|
21
|
-
}
|
|
22
|
-
/**
|
|
23
|
-
* Partial config payload accepted by `Curve.setConfig(...)`.
|
|
24
|
-
*/
|
|
25
|
-
export type CurveConfigUpdate = Partial<Omit<ICurveOptions, "translation" | "rotation" | "scale">>;
|
|
26
|
-
/**
|
|
27
|
-
* Alias for `Curve` placement updates.
|
|
28
|
-
*/
|
|
29
|
-
export type CurvePlacementUpdate = CurvePlacementOptions;
|
|
30
|
-
/**
|
|
31
|
-
* Offset result returned by `Curve.offset(...)`.
|
|
32
|
-
*/
|
|
33
|
-
export interface ICurveOffsetResult {
|
|
34
|
-
points: Vector3[];
|
|
35
|
-
beveledVertexIndices: number[];
|
|
36
|
-
isClosed: boolean;
|
|
37
|
-
}
|
|
38
|
-
/**
|
|
39
|
-
* Curve wrapper backed by the kernel OGCurve primitive.
|
|
40
|
-
*/
|
|
41
|
-
export declare class Curve extends THREE.Line {
|
|
42
|
-
ogid: string;
|
|
43
|
-
options: ICurveOptions;
|
|
44
|
-
private curve;
|
|
45
|
-
set color(color: number);
|
|
46
|
-
constructor(options?: ICurveOptions);
|
|
47
|
-
setConfig(options: CurveConfigUpdate): void;
|
|
48
|
-
getConfig(): ICurveOptions;
|
|
49
|
-
getAnchor(): Vector3;
|
|
50
|
-
setAnchor(anchor: Vector3): void;
|
|
51
|
-
resetAnchor(): void;
|
|
52
|
-
setPlacement(placement: CurvePlacementUpdate): void;
|
|
53
|
-
setTransform(translation: Vector3, rotation: Vector3, scale: Vector3): void;
|
|
54
|
-
setTranslation(translation: Vector3): void;
|
|
55
|
-
setRotation(rotation: Vector3): void;
|
|
56
|
-
setScale(scale: Vector3): void;
|
|
57
|
-
getPlacement(): import("../editor.js").ParametricPlacement;
|
|
58
|
-
getEditCapabilities(): import("../editor.js").ParametricEditCapabilities;
|
|
59
|
-
canConvertToFreeform(): boolean;
|
|
60
|
-
toFreeform(id?: string): import("../freeform.js").FreeformGeometry;
|
|
61
|
-
private generateGeometry;
|
|
62
|
-
getOffset(distance: number, acuteThresholdDegrees?: number, bevel?: boolean): ICurveOffsetResult;
|
|
63
|
-
private writePositionsToGeometry;
|
|
64
|
-
}
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
import * as THREE from "three";
|
|
2
|
-
import { Vector3 } from "../../opengeometry/pkg/opengeometry.js";
|
|
3
|
-
import { AnalyticCurve, type AnalyticCurveStats } from "./analytic-curve.js";
|
|
4
|
-
import type { AnalyticAccuracy } from "../shapes/analytic-solid.js";
|
|
5
|
-
export interface IEllipticalArcOptions {
|
|
6
|
-
ogid?: string;
|
|
7
|
-
center?: Vector3;
|
|
8
|
-
majorRadius?: number;
|
|
9
|
-
minorRadius?: number;
|
|
10
|
-
startAngle?: number;
|
|
11
|
-
sweepAngle?: number;
|
|
12
|
-
deflection?: number;
|
|
13
|
-
accuracy?: AnalyticAccuracy;
|
|
14
|
-
color?: THREE.ColorRepresentation;
|
|
15
|
-
}
|
|
16
|
-
export type EllipticalArcConfigUpdate = Partial<Omit<IEllipticalArcOptions, "ogid">>;
|
|
17
|
-
interface NormalizedEllipticalArcOptions {
|
|
18
|
-
ogid?: string;
|
|
19
|
-
center: Vector3;
|
|
20
|
-
majorRadius: number;
|
|
21
|
-
minorRadius: number;
|
|
22
|
-
startAngle: number;
|
|
23
|
-
sweepAngle: number;
|
|
24
|
-
deflection: number;
|
|
25
|
-
accuracy?: AnalyticAccuracy;
|
|
26
|
-
color: THREE.ColorRepresentation;
|
|
27
|
-
}
|
|
28
|
-
/** Authoritative elliptical edge with transient deflection tessellation. */
|
|
29
|
-
export declare class EllipticalArc extends AnalyticCurve {
|
|
30
|
-
options: Readonly<NormalizedEllipticalArcOptions>;
|
|
31
|
-
constructor(options?: IEllipticalArcOptions);
|
|
32
|
-
getAnchor(): Vector3;
|
|
33
|
-
getConfig(): Readonly<NormalizedEllipticalArcOptions>;
|
|
34
|
-
setConfig(update: EllipticalArcConfigUpdate): AnalyticCurveStats;
|
|
35
|
-
getBrep(): Record<string, unknown>;
|
|
36
|
-
retessellate(deflection: number): AnalyticCurveStats;
|
|
37
|
-
}
|
|
38
|
-
export {};
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* 2D and path primitive wrappers backed by the OpenGeometry kernel.
|
|
3
|
-
*/
|
|
4
|
-
export * from './line.js';
|
|
5
|
-
export * from './polyline.js';
|
|
6
|
-
export * from './arc.js';
|
|
7
|
-
export * from './rectangle.js';
|
|
8
|
-
export * from './curve.js';
|
|
9
|
-
export * from "./elliptical_arc.js";
|
package/src/primitives/line.d.ts
DELETED
|
@@ -1,77 +0,0 @@
|
|
|
1
|
-
import { Vector3 } from "../../opengeometry/pkg/opengeometry.js";
|
|
2
|
-
import * as THREE from "three";
|
|
3
|
-
/**
|
|
4
|
-
* Construction options for a line segment wrapper.
|
|
5
|
-
*/
|
|
6
|
-
export interface ILineOptions {
|
|
7
|
-
ogid?: string;
|
|
8
|
-
start: Vector3;
|
|
9
|
-
end: Vector3;
|
|
10
|
-
color: number;
|
|
11
|
-
fatLines?: boolean;
|
|
12
|
-
width?: number;
|
|
13
|
-
translation?: Vector3;
|
|
14
|
-
rotation?: Vector3;
|
|
15
|
-
scale?: Vector3;
|
|
16
|
-
}
|
|
17
|
-
/**
|
|
18
|
-
* Placement updates accepted by `Line`.
|
|
19
|
-
*/
|
|
20
|
-
export interface LinePlacementOptions {
|
|
21
|
-
translation?: Vector3;
|
|
22
|
-
rotation?: Vector3;
|
|
23
|
-
scale?: Vector3;
|
|
24
|
-
}
|
|
25
|
-
/**
|
|
26
|
-
* Partial config payload accepted by `Line.setConfig(...)`.
|
|
27
|
-
*/
|
|
28
|
-
export type LineConfigUpdate = Partial<Omit<ILineOptions, "translation" | "rotation" | "scale">>;
|
|
29
|
-
/**
|
|
30
|
-
* Alias for `Line` placement updates.
|
|
31
|
-
*/
|
|
32
|
-
export type LinePlacementUpdate = LinePlacementOptions;
|
|
33
|
-
/**
|
|
34
|
-
* Offset result returned by `Line.offset(...)`.
|
|
35
|
-
*/
|
|
36
|
-
export interface ILineOffsetResult {
|
|
37
|
-
points: Vector3[];
|
|
38
|
-
beveledVertexIndices: number[];
|
|
39
|
-
isClosed: boolean;
|
|
40
|
-
}
|
|
41
|
-
/**
|
|
42
|
-
* Simple Line defined by Two Points
|
|
43
|
-
*/
|
|
44
|
-
export declare class Line extends THREE.Line {
|
|
45
|
-
ogid: string;
|
|
46
|
-
options: ILineOptions;
|
|
47
|
-
private line;
|
|
48
|
-
private fatLine;
|
|
49
|
-
set color(color: number);
|
|
50
|
-
constructor(options?: ILineOptions);
|
|
51
|
-
validateOptions(): void;
|
|
52
|
-
setConfig(options: LineConfigUpdate): void;
|
|
53
|
-
getConfig(): ILineOptions;
|
|
54
|
-
getAnchor(): Vector3;
|
|
55
|
-
setAnchor(anchor: Vector3): void;
|
|
56
|
-
resetAnchor(): void;
|
|
57
|
-
setPlacement(placement: LinePlacementUpdate): void;
|
|
58
|
-
setTransform(translation: Vector3, rotation: Vector3, scale: Vector3): void;
|
|
59
|
-
setTranslation(translation: Vector3): void;
|
|
60
|
-
setRotation(rotation: Vector3): void;
|
|
61
|
-
setScale(scale: Vector3): void;
|
|
62
|
-
getPlacement(): import("../editor.js").ParametricPlacement;
|
|
63
|
-
getEditCapabilities(): import("../editor.js").ParametricEditCapabilities;
|
|
64
|
-
canConvertToFreeform(): boolean;
|
|
65
|
-
toFreeform(id?: string): import("../freeform.js").FreeformGeometry;
|
|
66
|
-
/**
|
|
67
|
-
* Every time there are property changes, geometry needs to be discarded and regenerated.
|
|
68
|
-
* This is to ensure that the geometry is always up-to-date with the current state.
|
|
69
|
-
*/
|
|
70
|
-
discardGeometry(): void;
|
|
71
|
-
private getCurrentPositions;
|
|
72
|
-
private updateRenderStyle;
|
|
73
|
-
private generateGeometry;
|
|
74
|
-
getDXF(): string;
|
|
75
|
-
getOffset(distance: number, acuteThresholdDegrees?: number, bevel?: boolean): ILineOffsetResult;
|
|
76
|
-
private writePositionsToGeometry;
|
|
77
|
-
}
|
|
@@ -1,78 +0,0 @@
|
|
|
1
|
-
import * as THREE from 'three';
|
|
2
|
-
import { Vector3 } from '../../opengeometry/pkg/opengeometry.js';
|
|
3
|
-
/**
|
|
4
|
-
* Construction options for an ordered polyline wrapper.
|
|
5
|
-
*/
|
|
6
|
-
export interface IPolylineOptions {
|
|
7
|
-
ogid?: string;
|
|
8
|
-
color: number;
|
|
9
|
-
points: Vector3[];
|
|
10
|
-
fatLines?: boolean;
|
|
11
|
-
width?: number;
|
|
12
|
-
translation?: Vector3;
|
|
13
|
-
rotation?: Vector3;
|
|
14
|
-
scale?: Vector3;
|
|
15
|
-
}
|
|
16
|
-
/**
|
|
17
|
-
* Placement updates accepted by `Polyline`.
|
|
18
|
-
*/
|
|
19
|
-
export interface PolylinePlacementOptions {
|
|
20
|
-
translation?: Vector3;
|
|
21
|
-
rotation?: Vector3;
|
|
22
|
-
scale?: Vector3;
|
|
23
|
-
}
|
|
24
|
-
/**
|
|
25
|
-
* Partial config payload accepted by `Polyline.setConfig(...)`.
|
|
26
|
-
*/
|
|
27
|
-
export type PolylineConfigUpdate = Partial<Omit<IPolylineOptions, "translation" | "rotation" | "scale">>;
|
|
28
|
-
/**
|
|
29
|
-
* Alias for `Polyline` placement updates.
|
|
30
|
-
*/
|
|
31
|
-
export type PolylinePlacementUpdate = PolylinePlacementOptions;
|
|
32
|
-
/**
|
|
33
|
-
* Offset result returned by `Polyline.offset(...)`.
|
|
34
|
-
*/
|
|
35
|
-
export interface IOffsetResult {
|
|
36
|
-
points: Vector3[];
|
|
37
|
-
beveledVertexIndices: number[];
|
|
38
|
-
isClosed: boolean;
|
|
39
|
-
}
|
|
40
|
-
/**
|
|
41
|
-
* Polyline wrapper backed by the kernel OGPolyline primitive.
|
|
42
|
-
*/
|
|
43
|
-
export declare class Polyline extends THREE.Line {
|
|
44
|
-
ogid: string;
|
|
45
|
-
options: IPolylineOptions;
|
|
46
|
-
isClosed: boolean;
|
|
47
|
-
private polyline;
|
|
48
|
-
private fatLine;
|
|
49
|
-
transformationMatrix: THREE.Matrix4;
|
|
50
|
-
set color(color: number);
|
|
51
|
-
constructor(options?: IPolylineOptions);
|
|
52
|
-
validateOptions(): void;
|
|
53
|
-
setConfig(options: PolylineConfigUpdate): void;
|
|
54
|
-
getConfig(): IPolylineOptions;
|
|
55
|
-
getAnchor(): Vector3;
|
|
56
|
-
setAnchor(anchor: Vector3): void;
|
|
57
|
-
resetAnchor(): void;
|
|
58
|
-
setPlacement(placement: PolylinePlacementUpdate): void;
|
|
59
|
-
setTransform(translation: Vector3, rotation: Vector3, scale: Vector3): void;
|
|
60
|
-
setTranslation(translation: Vector3): void;
|
|
61
|
-
setRotation(rotation: Vector3): void;
|
|
62
|
-
setScale(scale: Vector3): void;
|
|
63
|
-
getPlacement(): import("../editor.js").ParametricPlacement;
|
|
64
|
-
getEditCapabilities(): import("../editor.js").ParametricEditCapabilities;
|
|
65
|
-
canConvertToFreeform(): boolean;
|
|
66
|
-
toFreeform(id?: string): import("../freeform.js").FreeformGeometry;
|
|
67
|
-
addPoint(point: Vector3): void;
|
|
68
|
-
/**
|
|
69
|
-
* Every time there are property changes, geometry needs to be discarded and regenerated.
|
|
70
|
-
* This is to ensure that the geometry is always up-to-date with the current state.
|
|
71
|
-
*/
|
|
72
|
-
discardGeometry(): void;
|
|
73
|
-
private getCurrentPositions;
|
|
74
|
-
private updateRenderStyle;
|
|
75
|
-
private generateGeometry;
|
|
76
|
-
getOffset(distance: number, acuteThresholdDegrees?: number, bevel?: boolean): IOffsetResult;
|
|
77
|
-
private writePositionsToGeometry;
|
|
78
|
-
}
|
|
@@ -1,72 +0,0 @@
|
|
|
1
|
-
import { Vector3 } from "../../opengeometry/pkg/opengeometry.js";
|
|
2
|
-
import * as THREE from "three";
|
|
3
|
-
/**
|
|
4
|
-
* Construction options for a rectangle profile wrapper.
|
|
5
|
-
*/
|
|
6
|
-
export interface IRectangleOptions {
|
|
7
|
-
ogid?: string;
|
|
8
|
-
center: Vector3;
|
|
9
|
-
width: number;
|
|
10
|
-
breadth: number;
|
|
11
|
-
color: number;
|
|
12
|
-
fatLines?: boolean;
|
|
13
|
-
lineWidth?: number;
|
|
14
|
-
translation?: Vector3;
|
|
15
|
-
rotation?: Vector3;
|
|
16
|
-
scale?: Vector3;
|
|
17
|
-
}
|
|
18
|
-
/**
|
|
19
|
-
* Placement updates accepted by `Rectangle`.
|
|
20
|
-
*/
|
|
21
|
-
export interface RectanglePlacementOptions {
|
|
22
|
-
translation?: Vector3;
|
|
23
|
-
rotation?: Vector3;
|
|
24
|
-
scale?: Vector3;
|
|
25
|
-
}
|
|
26
|
-
/**
|
|
27
|
-
* Partial config payload accepted by `Rectangle.setConfig(...)`.
|
|
28
|
-
*/
|
|
29
|
-
export type RectangleConfigUpdate = Partial<Omit<IRectangleOptions, "translation" | "rotation" | "scale">>;
|
|
30
|
-
/**
|
|
31
|
-
* Alias for `Rectangle` placement updates.
|
|
32
|
-
*/
|
|
33
|
-
export type RectanglePlacementUpdate = RectanglePlacementOptions;
|
|
34
|
-
/**
|
|
35
|
-
* Offset result returned by `Rectangle.offset(...)`.
|
|
36
|
-
*/
|
|
37
|
-
export interface IRectangleOffsetResult {
|
|
38
|
-
points: Vector3[];
|
|
39
|
-
beveledVertexIndices: number[];
|
|
40
|
-
isClosed: boolean;
|
|
41
|
-
}
|
|
42
|
-
/**
|
|
43
|
-
* Rectangle wrapper backed by the kernel OGRectangle primitive.
|
|
44
|
-
*/
|
|
45
|
-
export declare class Rectangle extends THREE.Line {
|
|
46
|
-
ogid: string;
|
|
47
|
-
options: IRectangleOptions;
|
|
48
|
-
private polyLineRectangle;
|
|
49
|
-
private fatLine;
|
|
50
|
-
set color(color: number);
|
|
51
|
-
constructor(options?: IRectangleOptions);
|
|
52
|
-
validateOptions(): void;
|
|
53
|
-
setConfig(options: RectangleConfigUpdate): void;
|
|
54
|
-
getAnchor(): Vector3;
|
|
55
|
-
setPlacement(placement: RectanglePlacementUpdate): void;
|
|
56
|
-
setTransform(translation: Vector3, rotation: Vector3, scale: Vector3): void;
|
|
57
|
-
setTranslation(translation: Vector3): void;
|
|
58
|
-
setRotation(rotation: Vector3): void;
|
|
59
|
-
setScale(scale: Vector3): void;
|
|
60
|
-
getConfig(): IRectangleOptions;
|
|
61
|
-
getPlacement(): import("../editor.js").ParametricPlacement;
|
|
62
|
-
getEditCapabilities(): import("../editor.js").ParametricEditCapabilities;
|
|
63
|
-
canConvertToFreeform(): boolean;
|
|
64
|
-
toFreeform(id?: string): import("../freeform.js").FreeformGeometry;
|
|
65
|
-
private getCurrentPositions;
|
|
66
|
-
private updateRenderStyle;
|
|
67
|
-
private generateGeometry;
|
|
68
|
-
getBrep(): any;
|
|
69
|
-
getOffset(distance: number, acuteThresholdDegrees?: number, bevel?: boolean): IRectangleOffsetResult;
|
|
70
|
-
discardGeometry(): void;
|
|
71
|
-
private writePositionsToGeometry;
|
|
72
|
-
}
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import * as THREE from "three";
|
|
2
|
-
import type { AnalyticSolid, AnalyticTessellationStats } from "../shapes/analytic-solid.js";
|
|
3
|
-
import { AnalyticTessellationWorker } from "./analytic-tessellation.js";
|
|
4
|
-
export declare function deflectionBucket(target: number, previous?: number): number;
|
|
5
|
-
export declare function worldUnitsPerPixel(camera: THREE.PerspectiveCamera | THREE.OrthographicCamera, depth: number, physicalHeight: number): number;
|
|
6
|
-
export interface AnalyticLodOptions {
|
|
7
|
-
fixedDeflection?: number;
|
|
8
|
-
onUpdate?: (solid: AnalyticSolid, statistics: AnalyticTessellationStats) => void;
|
|
9
|
-
onError?: (solid: AnalyticSolid, error: Error) => void;
|
|
10
|
-
}
|
|
11
|
-
/** Register authored changes explicitly; camera meshes never refresh a scene's authored BRep snapshots. */
|
|
12
|
-
export declare class AnalyticLodController {
|
|
13
|
-
private readonly worker;
|
|
14
|
-
private readonly options;
|
|
15
|
-
private readonly entries;
|
|
16
|
-
private readonly cameraState;
|
|
17
|
-
private lastMotion;
|
|
18
|
-
private lastSchedule;
|
|
19
|
-
private initialized;
|
|
20
|
-
private closed;
|
|
21
|
-
private refining;
|
|
22
|
-
private fixedDeflection?;
|
|
23
|
-
constructor(worker: AnalyticTessellationWorker, options?: AnalyticLodOptions);
|
|
24
|
-
setDeflection(deflection?: number): void;
|
|
25
|
-
register(solid: AnalyticSolid): Promise<void>;
|
|
26
|
-
unregister(solid: AnalyticSolid): Promise<void>;
|
|
27
|
-
update(camera: THREE.PerspectiveCamera | THREE.OrthographicCamera, physicalHeight: number, now?: number, motion?: boolean): void;
|
|
28
|
-
/** Explicit export refinement; a resource or precision failure rejects and retains each body's prior mesh. */
|
|
29
|
-
refine(deflection: number): Promise<void>;
|
|
30
|
-
dispose(): void;
|
|
31
|
-
}
|
|
32
|
-
export declare function uniformScale(matrix: THREE.Matrix4): number;
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
export interface AnalyticTessellationData {
|
|
2
|
-
positions: Float64Array;
|
|
3
|
-
normals: Float32Array;
|
|
4
|
-
indices: Uint32Array;
|
|
5
|
-
triangleFaceIds: Uint32Array;
|
|
6
|
-
outlinePositions: Float64Array;
|
|
7
|
-
outlineEdgeIds: Uint32Array;
|
|
8
|
-
revision: bigint;
|
|
9
|
-
achievedDeflection: number;
|
|
10
|
-
}
|
|
11
|
-
export declare const GEOMETRY_DEFLECTION_SHARE = 0.75;
|
|
12
|
-
export interface AnalyticWorkerOptions {
|
|
13
|
-
workerURL: string | URL;
|
|
14
|
-
kernelURL: string | URL;
|
|
15
|
-
wasmURL: string | URL;
|
|
16
|
-
}
|
|
17
|
-
export declare class AnalyticTessellationWorker {
|
|
18
|
-
private readonly worker;
|
|
19
|
-
private readonly pending;
|
|
20
|
-
private readonly generations;
|
|
21
|
-
private readonly ready;
|
|
22
|
-
private serial;
|
|
23
|
-
private closed;
|
|
24
|
-
constructor(options: AnalyticWorkerOptions);
|
|
25
|
-
setModel(handle: string, serialized: string): Promise<void>;
|
|
26
|
-
tessellate(handle: string, deflection: number): Promise<AnalyticTessellationData>;
|
|
27
|
-
cancel(handle: string): number;
|
|
28
|
-
removeModel(handle: string): Promise<void>;
|
|
29
|
-
dispose(): void;
|
|
30
|
-
private send;
|
|
31
|
-
private fail;
|
|
32
|
-
}
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import * as THREE from "three";
|
|
2
|
-
import { AnalyticSolid } from "./analytic-solid.js";
|
|
3
|
-
export interface AnalyticPatternInstance {
|
|
4
|
-
id?: string;
|
|
5
|
-
matrix: THREE.Matrix4;
|
|
6
|
-
}
|
|
7
|
-
export interface AnalyticPatternHit {
|
|
8
|
-
pattern: AnalyticPattern;
|
|
9
|
-
instanceIndex: number;
|
|
10
|
-
instanceId: string;
|
|
11
|
-
source: AnalyticSolid;
|
|
12
|
-
faceId?: number;
|
|
13
|
-
}
|
|
14
|
-
/**
|
|
15
|
-
* Renders many rigid placements of one authoritative analytic body. The source
|
|
16
|
-
* owns the BRep; instances own only identity and placement matrices.
|
|
17
|
-
*/
|
|
18
|
-
export declare class AnalyticPattern extends THREE.Group {
|
|
19
|
-
readonly source: AnalyticSolid;
|
|
20
|
-
readonly surface: THREE.InstancedMesh<THREE.BufferGeometry, THREE.Material>;
|
|
21
|
-
readonly instanceIds: readonly string[];
|
|
22
|
-
private disposed;
|
|
23
|
-
constructor(source: AnalyticSolid, instances: readonly AnalyticPatternInstance[]);
|
|
24
|
-
get count(): number;
|
|
25
|
-
setInstanceMatrix(index: number, matrix: THREE.Matrix4): void;
|
|
26
|
-
resolveIntersection(intersection: THREE.Intersection): AnalyticPatternHit | undefined;
|
|
27
|
-
dispose(): void;
|
|
28
|
-
private checkActive;
|
|
29
|
-
}
|
|
30
|
-
export declare function linearPattern(source: AnalyticSolid, count: number, spacing: THREE.Vector3): AnalyticPattern;
|
|
31
|
-
export declare function rectangularPattern(source: AnalyticSolid, counts: readonly [number, number], spacing: readonly [THREE.Vector3, THREE.Vector3]): AnalyticPattern;
|
|
32
|
-
export declare function circularPattern(source: AnalyticSolid, count: number, radius: number, options?: {
|
|
33
|
-
startAngle?: number;
|
|
34
|
-
sweepAngle?: number;
|
|
35
|
-
rotateInstances?: boolean;
|
|
36
|
-
}): AnalyticPattern;
|