@constructorfleet/sketchforge-engine 1.19.0 → 1.21.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/README.md +3 -3
- package/dist/domain/sketchforge.d.ts +43 -0
- package/dist/domain/sketchforge.d.ts.map +1 -1
- package/dist/engine.d.ts +1 -1
- package/dist/engine.d.ts.map +1 -1
- package/dist/engine.js +482 -29
- package/dist/engine.js.map +1 -1
- package/dist/faceDraftSegmentLineage.d.ts +45 -0
- package/dist/faceDraftSegmentLineage.d.ts.map +1 -0
- package/dist/faceDraftSegmentLineage.js +200 -0
- package/dist/faceDraftSegmentLineage.js.map +1 -0
- package/dist/faceLineage.d.ts +10 -0
- package/dist/faceLineage.d.ts.map +1 -0
- package/dist/faceLineage.js +84 -0
- package/dist/faceLineage.js.map +1 -0
- package/dist/parametricRecompute.d.ts +2 -0
- package/dist/parametricRecompute.d.ts.map +1 -1
- package/dist/parametricRecompute.js +152 -0
- package/dist/parametricRecompute.js.map +1 -1
- package/dist/revolveRequests.d.ts +12 -0
- package/dist/revolveRequests.d.ts.map +1 -1
- package/dist/serverCadOperations.d.ts +54 -3
- package/dist/serverCadOperations.d.ts.map +1 -1
- package/dist/serverCadOperations.js +224 -6
- package/dist/serverCadOperations.js.map +1 -1
- package/dist/serverCadShell.d.ts +3 -1
- package/dist/serverCadShell.d.ts.map +1 -1
- package/dist/serverCadShell.js +15 -5
- package/dist/serverCadShell.js.map +1 -1
- package/dist/sketchExtrusionRequest.d.ts.map +1 -1
- package/dist/sketchExtrusionRequest.js +1 -0
- package/dist/sketchExtrusionRequest.js.map +1 -1
- package/dist/skfProject.d.ts.map +1 -1
- package/dist/skfProject.js +210 -8
- package/dist/skfProject.js.map +1 -1
- package/dist/stepComponentMetadata.d.ts.map +1 -1
- package/dist/stepComponentMetadata.js +55 -2
- package/dist/stepComponentMetadata.js.map +1 -1
- package/dist/stepExport.d.ts.map +1 -1
- package/dist/stepExport.js +54 -8
- package/dist/stepExport.js.map +1 -1
- package/dist/stepGlbColors.d.ts.map +1 -1
- package/dist/stepGlbColors.js +10 -2
- package/dist/stepGlbColors.js.map +1 -1
- package/dist/support/lib/operator-configuration.json +10 -0
- package/package.json +1 -1
|
@@ -9,6 +9,8 @@ export type RecomputeTreeResult = {
|
|
|
9
9
|
reason: "recompute_failed" | "dependency_missing" | "dependency_ambiguous";
|
|
10
10
|
message?: string;
|
|
11
11
|
};
|
|
12
|
+
/** Replay one supported all-edge treatment on rebuilt source geometry without carrying transient edge indexes forward. */
|
|
13
|
+
export declare function replaySingleAllEdgeTreatment(original: WorkplaneShape, rebuilt: WorkplaneShape, draftPrismAngle?: number | undefined): Promise<WorkplaneShape>;
|
|
12
14
|
/** Find a retained sketch output anywhere in the feature tree, replace it, then rebuild boolean ancestors bottom-up. */
|
|
13
15
|
export declare function recomputeSketchOutput(roots: WorkplaneShape[], sourceId: string, replacement: WorkplaneShape): Promise<RecomputeTreeResult>;
|
|
14
16
|
export declare function findSketchOutput(roots: WorkplaneShape[], sourceId: string): WorkplaneShape[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"parametricRecompute.d.ts","sourceRoot":"","sources":["../src/parametricRecompute.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"parametricRecompute.d.ts","sourceRoot":"","sources":["../src/parametricRecompute.ts"],"names":[],"mappings":"AAWA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AAE9D,MAAM,MAAM,mBAAmB,GAC3B;IAAE,EAAE,EAAE,IAAI,CAAC;IAAC,MAAM,EAAE,cAAc,EAAE,CAAC;IAAC,OAAO,EAAE,cAAc,CAAC;IAAC,UAAU,EAAE,MAAM,CAAA;CAAE,GACnF;IAAE,EAAE,EAAE,KAAK,CAAC;IAAC,MAAM,EAAE,kBAAkB,GAAG,oBAAoB,GAAG,sBAAsB,CAAC;IAAC,OAAO,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC;AAmBhH,0HAA0H;AAC1H,wBAAsB,4BAA4B,CAChD,QAAQ,EAAE,cAAc,EACxB,OAAO,EAAE,cAAc,EACvB,eAAe,qBAA2B,GACzC,OAAO,CAAC,cAAc,CAAC,CA+HzB;AAED,wHAAwH;AACxH,wBAAsB,qBAAqB,CACzC,KAAK,EAAE,cAAc,EAAE,EACvB,QAAQ,EAAE,MAAM,EAChB,WAAW,EAAE,cAAc,GAC1B,OAAO,CAAC,mBAAmB,CAAC,CAoE9B;AAED,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,cAAc,EAAE,EAAE,QAAQ,EAAE,MAAM,GAAG,cAAc,EAAE,CAQ5F"}
|
|
@@ -1,4 +1,156 @@
|
|
|
1
1
|
import { buildGroupFromSelection } from "./serverShapeBooleans.js";
|
|
2
|
+
import { allEdgeTreatmentEdgeCount, applyDraftPrism, applyEdgeTreatment, applySketchFaceDraft, shapeWithCadResult, } from "./serverCadOperations.js";
|
|
3
|
+
import { shapeFaces } from "./serverCadShell.js";
|
|
4
|
+
import { cadSketchRegions, cadSketchSweepPaths } from "./sketchCadProfile.js";
|
|
5
|
+
import { draftFaceForSketchSegment, legacyDraftSegmentForShape } from "./faceDraftSegmentLineage.js";
|
|
6
|
+
function appliedFrame(shape) {
|
|
7
|
+
return {
|
|
8
|
+
x: shape.x,
|
|
9
|
+
z: shape.z,
|
|
10
|
+
elevation: shape.elevation ?? 0,
|
|
11
|
+
width: shape.width,
|
|
12
|
+
depth: shape.depth,
|
|
13
|
+
height: shape.height,
|
|
14
|
+
rotation: shape.rotation ?? 0,
|
|
15
|
+
rotationX: shape.rotationX ?? 0,
|
|
16
|
+
rotationZ: shape.rotationZ ?? 0,
|
|
17
|
+
mirrorX: Boolean(shape.mirrorX),
|
|
18
|
+
mirrorY: Boolean(shape.mirrorY),
|
|
19
|
+
mirrorZ: Boolean(shape.mirrorZ),
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
/** Replay one supported all-edge treatment on rebuilt source geometry without carrying transient edge indexes forward. */
|
|
23
|
+
export async function replaySingleAllEdgeTreatment(original, rebuilt, draftPrismAngle = original.draftPrismAngle) {
|
|
24
|
+
const features = original.edgeTreatments ?? [];
|
|
25
|
+
const history = original.edgeTreatmentHistory ?? [];
|
|
26
|
+
if (features.length === 0 && history.length === 0)
|
|
27
|
+
return rebuilt;
|
|
28
|
+
const feature = features[0];
|
|
29
|
+
const historyFeature = history[0]?.feature;
|
|
30
|
+
const revolveSettings = original.sketchRevolve;
|
|
31
|
+
const supportedFaceDraftRevolve = original.sketchOperation === "revolve"
|
|
32
|
+
&& revolveSettings !== undefined
|
|
33
|
+
&& Math.abs(Math.abs(revolveSettings.sweepAngle) - 360) < 1e-6
|
|
34
|
+
&& (revolveSettings.pitch ?? 0) === 0
|
|
35
|
+
&& (revolveSettings.coreRadius ?? 0) === 0
|
|
36
|
+
&& (feature?.kind === "chamfer" || feature?.kind === "fillet");
|
|
37
|
+
const extrusionRegions = original.sketchOperation === "extrude" && original.sketchProfile
|
|
38
|
+
? cadSketchRegions(original.sketchProfile)
|
|
39
|
+
: [];
|
|
40
|
+
const supportedFaceDraftExtrusionTreatment = original.sketchOperation === "extrude"
|
|
41
|
+
&& extrusionRegions.length === 1
|
|
42
|
+
&& extrusionRegions[0]?.holes.length === 0
|
|
43
|
+
&& (feature?.kind === "fillet" || feature?.kind === "chamfer");
|
|
44
|
+
let supportedFaceDraftSweep = false;
|
|
45
|
+
if (original.sketchOperation === "sweep" && original.sketchProfile) {
|
|
46
|
+
try {
|
|
47
|
+
const { sections, spine } = cadSketchSweepPaths(original.sketchProfile);
|
|
48
|
+
supportedFaceDraftSweep = sections.length === 1 && sections[0]?.holes.length === 0 && spine.steps.length > 0;
|
|
49
|
+
}
|
|
50
|
+
catch {
|
|
51
|
+
supportedFaceDraftSweep = false;
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
const supportedFaceDraftTreatmentKind = (feature?.kind === "fillet" || feature?.kind === "chamfer")
|
|
55
|
+
&& (supportedFaceDraftExtrusionTreatment || supportedFaceDraftRevolve || supportedFaceDraftSweep);
|
|
56
|
+
const supportedFaceDraftTreatment = original.faceDraft !== undefined
|
|
57
|
+
&& features.length === 1
|
|
58
|
+
&& history.length === 1
|
|
59
|
+
&& historyFeature?.kind === feature?.kind
|
|
60
|
+
&& feature?.allEdges === true
|
|
61
|
+
&& historyFeature.allEdges === true
|
|
62
|
+
&& supportedFaceDraftTreatmentKind
|
|
63
|
+
&& (feature.kind !== "chamfer" || Math.abs((feature.chamferAngle ?? 45) - 45) < 0.001)
|
|
64
|
+
&& (historyFeature.kind !== "chamfer" || Math.abs((historyFeature.chamferAngle ?? 45) - 45) < 0.001);
|
|
65
|
+
if (original.faceDraft !== undefined && !supportedFaceDraftTreatment) {
|
|
66
|
+
throw new Error("A face draft can replay one symmetric 45-degree all-edge chamfer or all-edge fillet on a single-loop sketch extrusion, one symmetric 45-degree all-edge chamfer or all-edge fillet on a single-section sketch sweep, or one symmetric all-edge chamfer or all-edge fillet on a plain full-turn revolve.");
|
|
67
|
+
}
|
|
68
|
+
if (features.length !== 1 || history.length !== 1
|
|
69
|
+
|| !feature || !historyFeature
|
|
70
|
+
|| feature.allEdges !== true || historyFeature.allEdges !== true
|
|
71
|
+
|| historyFeature.kind !== feature.kind
|
|
72
|
+
|| historyFeature.amount !== feature.amount
|
|
73
|
+
|| (feature.kind === "chamfer" && feature.chamferAngle !== undefined && Math.abs(feature.chamferAngle - 45) >= 0.001)
|
|
74
|
+
|| (historyFeature.kind === "chamfer" && historyFeature.chamferAngle !== undefined && Math.abs(historyFeature.chamferAngle - 45) >= 0.001)
|
|
75
|
+
|| (feature.kind === "chamfer" && historyFeature.chamferAngle !== undefined && feature.chamferAngle !== undefined
|
|
76
|
+
&& Math.abs(historyFeature.chamferAngle - feature.chamferAngle) >= 0.001)) {
|
|
77
|
+
throw new Error("This source edit cannot safely replay its selected-edge treatments.");
|
|
78
|
+
}
|
|
79
|
+
const previousFeature = feature;
|
|
80
|
+
let treatmentSource = rebuilt;
|
|
81
|
+
if (draftPrismAngle !== undefined) {
|
|
82
|
+
treatmentSource = {
|
|
83
|
+
...shapeWithCadResult(rebuilt, await applyDraftPrism(rebuilt, { angle: draftPrismAngle })),
|
|
84
|
+
draftPrismAngle,
|
|
85
|
+
draftPrismSourceHeight: original.draftPrismSourceHeight ?? rebuilt.height,
|
|
86
|
+
...(original.draftPrismSourceFrame ?? rebuilt.draftPrismSourceFrame
|
|
87
|
+
? { draftPrismSourceFrame: original.draftPrismSourceFrame ?? rebuilt.draftPrismSourceFrame }
|
|
88
|
+
: {}),
|
|
89
|
+
};
|
|
90
|
+
}
|
|
91
|
+
if (original.faceDraft !== undefined && treatmentSource.faceDraft === undefined) {
|
|
92
|
+
const profileChanged = JSON.stringify(original.sketchProfile) !== JSON.stringify(rebuilt.sketchProfile);
|
|
93
|
+
const legacySegmentMatch = profileChanged && !original.faceDraftSourceSegmentId
|
|
94
|
+
? await legacyDraftSegmentForShape(original)
|
|
95
|
+
: undefined;
|
|
96
|
+
if (legacySegmentMatch?.status === "ambiguous") {
|
|
97
|
+
throw new Error("The saved face draft does not identify one source sketch segment.");
|
|
98
|
+
}
|
|
99
|
+
const sourceSegmentId = original.faceDraftSourceSegmentId
|
|
100
|
+
?? (legacySegmentMatch?.status === "matched" ? legacySegmentMatch.segmentId : undefined);
|
|
101
|
+
const segmentMatch = sourceSegmentId
|
|
102
|
+
? await draftFaceForSketchSegment(treatmentSource, sourceSegmentId)
|
|
103
|
+
: undefined;
|
|
104
|
+
if (segmentMatch && segmentMatch.status !== "matched"
|
|
105
|
+
&& (segmentMatch.status !== "unsupported" || original.faceDraftSourceSegmentId !== undefined)) {
|
|
106
|
+
throw new Error("The selected sketch segment no longer maps to exactly one extrusion side face.");
|
|
107
|
+
}
|
|
108
|
+
const useSegmentLineage = segmentMatch?.status === "matched";
|
|
109
|
+
const sourceNormal = useSegmentLineage ? segmentMatch.normal : original.faceDraft.sourceFaceNormal;
|
|
110
|
+
if (!sourceNormal)
|
|
111
|
+
throw new Error("The selected source face has no stable planar reference.");
|
|
112
|
+
const matchingFaces = useSegmentLineage
|
|
113
|
+
? [{ id: segmentMatch.faceId }]
|
|
114
|
+
: (await shapeFaces(treatmentSource)).filter((face) => face.surfaceType === "plane" && face.normal
|
|
115
|
+
&& Math.hypot(face.normal.x - sourceNormal.x, face.normal.y - sourceNormal.y, face.normal.z - sourceNormal.z) <= 1e-5);
|
|
116
|
+
if (matchingFaces.length !== 1)
|
|
117
|
+
throw new Error("The selected source face is missing or ambiguous after the sketch edit.");
|
|
118
|
+
const matchedFace = matchingFaces[0];
|
|
119
|
+
const faceSegmentMatch = useSegmentLineage
|
|
120
|
+
? segmentMatch
|
|
121
|
+
: undefined;
|
|
122
|
+
const faceDraft = original.faceDraft;
|
|
123
|
+
treatmentSource = {
|
|
124
|
+
...shapeWithCadResult(treatmentSource, await applySketchFaceDraft(treatmentSource, {
|
|
125
|
+
...faceDraft,
|
|
126
|
+
sourceFaceId: matchedFace.id,
|
|
127
|
+
})),
|
|
128
|
+
faceDraft: useSegmentLineage
|
|
129
|
+
? { ...faceDraft, sourceFaceId: matchedFace.id, sourceFaceNormal: sourceNormal }
|
|
130
|
+
: faceDraft,
|
|
131
|
+
...(useSegmentLineage ? { faceDraftSourceFaceIds: treatmentSource.faceIds } : {}),
|
|
132
|
+
...(faceSegmentMatch ? { faceDraftSourceSegmentId: faceSegmentMatch.segmentId } : {}),
|
|
133
|
+
faceDraftSourceFrame: original.faceDraftSourceFrame ?? treatmentSource.cadBrepFrame,
|
|
134
|
+
};
|
|
135
|
+
}
|
|
136
|
+
const result = await applyEdgeTreatment(treatmentSource, {
|
|
137
|
+
kind: previousFeature.kind,
|
|
138
|
+
amount: previousFeature.amount,
|
|
139
|
+
...(previousFeature.kind === "chamfer" ? { angle: previousFeature.chamferAngle ?? 45 } : {}),
|
|
140
|
+
});
|
|
141
|
+
const treated = shapeWithCadResult(treatmentSource, result);
|
|
142
|
+
const replayedFeature = {
|
|
143
|
+
...previousFeature,
|
|
144
|
+
edgeCount: await allEdgeTreatmentEdgeCount(treatmentSource, previousFeature.kind),
|
|
145
|
+
};
|
|
146
|
+
const before = structuredClone(treatmentSource);
|
|
147
|
+
const entry = history[0];
|
|
148
|
+
return {
|
|
149
|
+
...treated,
|
|
150
|
+
edgeTreatments: [replayedFeature],
|
|
151
|
+
edgeTreatmentHistory: [{ ...entry, feature: replayedFeature, before, appliedFrame: appliedFrame(treated) }],
|
|
152
|
+
};
|
|
153
|
+
}
|
|
2
154
|
/** Find a retained sketch output anywhere in the feature tree, replace it, then rebuild boolean ancestors bottom-up. */
|
|
3
155
|
export async function recomputeSketchOutput(roots, sourceId, replacement) {
|
|
4
156
|
let matchCount = 0;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"parametricRecompute.js","sourceRoot":"","sources":["../src/parametricRecompute.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,uBAAuB,EAAE,MAAM,0BAA0B,CAAC;AAOnE,wHAAwH;AACxH,MAAM,CAAC,KAAK,UAAU,qBAAqB,CACzC,KAAuB,EACvB,QAAgB,EAChB,WAA2B;IAE3B,IAAI,UAAU,GAAG,CAAC,CAAC;IACnB,IAAI,OAAmC,CAAC;IAExC,MAAM,KAAK,GAAG,KAAK,EAAE,KAAqB,EAA2B,EAAE;QACrE,IAAI,KAAK,CAAC,EAAE,KAAK,WAAW,CAAC,EAAE,IAAI,KAAK,CAAC,cAAc,KAAK,QAAQ,EAAE,CAAC;YACrE,UAAU,IAAI,CAAC,CAAC;YAChB,OAAO,GAAG,WAAW,CAAC;YACtB,OAAO,WAAW,CAAC;QACrB,CAAC;QACD,IAAI,CAAC,KAAK,CAAC,aAAa,EAAE,MAAM;YAAE,OAAO,KAAK,CAAC;QAE/C,MAAM,QAAQ,GAAqB,EAAE,CAAC;QACtC,IAAI,OAAO,GAAG,KAAK,CAAC;QACpB,KAAK,MAAM,KAAK,IAAI,KAAK,CAAC,aA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|
|
196
196
|
sketchProfile?: SketchProfile;
|
|
197
197
|
sketchOperation?: import("./domain/sketchforge.js").SketchOperation;
|
|
198
198
|
sketchRevolve?: SketchRevolveSettings;
|
|
199
|
+
draftPrismAngle?: number;
|
|
200
|
+
draftPrismSourceHeight?: number;
|
|
201
|
+
draftPrismSourceFrame?: import("./domain/sketchforge.js").CadBrepFrame;
|
|
202
|
+
faceDraft?: import("./domain/sketchforge.js").SketchFaceDraft;
|
|
203
|
+
faceDraftSourceFaceIds?: string[];
|
|
204
|
+
faceDraftSourceSegmentId?: string;
|
|
205
|
+
faceDraftSourceFrame?: import("./domain/sketchforge.js").CadBrepFrame;
|
|
206
|
+
faceDraftSourceScale?: {
|
|
207
|
+
width: number;
|
|
208
|
+
depth: number;
|
|
209
|
+
height: number;
|
|
210
|
+
};
|
|
199
211
|
edgeTreatments?: import("./domain/sketchforge.js").EdgeTreatmentFeature[];
|
|
200
212
|
edgeTreatmentHistory?: import("./domain/sketchforge.js").EdgeTreatmentHistoryEntry[];
|
|
201
213
|
cadDisplayEdges?: import("./domain/sketchforge.js").CadDisplayEdge[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"revolveRequests.d.ts","sourceRoot":"","sources":["../src/revolveRequests.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAcpD,OAAO,KAAK,EAAE,aAAa,EAAE,qBAAqB,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AAEpG,qEAAqE;AACrE,eAAO,MAAM,oBAAoB,IAAI,CAAC;AAEtC,eAAO,MAAM,kBAAkB,IAAI,CAAC;AACpC,eAAO,MAAM,kBAAkB,OAAO,CAAC;AAEvC,MAAM,MAAM,mBAAmB,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;AAEnD,MAAM,MAAM,oBAAoB,GAC5B;IAAE,EAAE,EAAE,IAAI,CAAC;IA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AE,CAelG;AAED;;;;;;GAMG;AACH,eAAO,MAAM,qBAAqB,2FAA4F,CAAC;AAE/H;;;;;GAKG;AACH,eAAO,MAAM,mBAAmB,mHAAoH,CAAC;AAErJ,+EAA+E;AAC/E,eAAO,MAAM,qBAAqB,4HAAuE,CAAC;AAE1G;;;;;;GAMG;AACH,wBAAgB,wBAAwB,CACtC,QAAQ,EAAE,qBAAqB,EAC/B,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAC5B,qBAAqB,CAUvB"}
|
|
@@ -14,8 +14,8 @@
|
|
|
14
14
|
* the result format, so a shape filleted here is indistinguishable in the
|
|
15
15
|
* editor from one filleted there.
|
|
16
16
|
*/
|
|
17
|
-
import type { OcctKernel, ShapeHandle } from "occt-wasm";
|
|
18
|
-
import type { WorkplaneShape } from "./domain/sketchforge.js";
|
|
17
|
+
import type { EvolutionData, OcctKernel, ShapeHandle } from "occt-wasm";
|
|
18
|
+
import type { SketchProfile, WorkplaneShape } from "./domain/sketchforge.js";
|
|
19
19
|
export type ServerCadEdge = {
|
|
20
20
|
index: number;
|
|
21
21
|
length: number;
|
|
@@ -46,6 +46,43 @@ export declare class ServerCadError extends Error {
|
|
|
46
46
|
readonly status: number;
|
|
47
47
|
constructor(message: string, status?: number);
|
|
48
48
|
}
|
|
49
|
+
declare const DRAFT_PULL_AXES: {
|
|
50
|
+
readonly x: {
|
|
51
|
+
readonly x: 1;
|
|
52
|
+
readonly y: 0;
|
|
53
|
+
readonly z: 0;
|
|
54
|
+
};
|
|
55
|
+
readonly y: {
|
|
56
|
+
readonly x: 0;
|
|
57
|
+
readonly y: 1;
|
|
58
|
+
readonly z: 0;
|
|
59
|
+
};
|
|
60
|
+
readonly z: {
|
|
61
|
+
readonly x: 0;
|
|
62
|
+
readonly y: 0;
|
|
63
|
+
readonly z: 1;
|
|
64
|
+
};
|
|
65
|
+
readonly "-x": {
|
|
66
|
+
readonly x: -1;
|
|
67
|
+
readonly y: 0;
|
|
68
|
+
readonly z: 0;
|
|
69
|
+
};
|
|
70
|
+
readonly "-y": {
|
|
71
|
+
readonly x: 0;
|
|
72
|
+
readonly y: -1;
|
|
73
|
+
readonly z: 0;
|
|
74
|
+
};
|
|
75
|
+
readonly "-z": {
|
|
76
|
+
readonly x: 0;
|
|
77
|
+
readonly y: 0;
|
|
78
|
+
readonly z: -1;
|
|
79
|
+
};
|
|
80
|
+
};
|
|
81
|
+
export type SketchFaceDraftRequest = {
|
|
82
|
+
sourceFaceId: string;
|
|
83
|
+
angle: number;
|
|
84
|
+
pullDirection: keyof typeof DRAFT_PULL_AXES;
|
|
85
|
+
};
|
|
49
86
|
/**
|
|
50
87
|
* Whether the kernel considers a shape sound.
|
|
51
88
|
*
|
|
@@ -129,6 +166,14 @@ export declare function applyBakedMirror(shape: WorkplaneShape, axis: "x" | "y"
|
|
|
129
166
|
* from, and the mesh is what the viewport draws.
|
|
130
167
|
*/
|
|
131
168
|
export declare function applyEdgeTreatment(shape: WorkplaneShape, treatment: ServerCadTreatment): Promise<ServerCadResult>;
|
|
169
|
+
/** Count currently chamferable/filletable edges without preserving topology indexes. */
|
|
170
|
+
export declare function allEdgeTreatmentEdgeCount(shape: WorkplaneShape, kind: ServerCadTreatment["kind"]): Promise<number>;
|
|
171
|
+
/** Build the analytical full-turn BREP for chamfering a retained plain revolve. */
|
|
172
|
+
export declare function isPlainFullTurnSketchRevolve(shape: WorkplaneShape): boolean;
|
|
173
|
+
/** Build the analytical BREP for a plain, single-region full-turn revolve. */
|
|
174
|
+
export declare function exactPlainSketchRevolveSolid(cad: OcctKernel, sketchProfile: SketchProfile, sketchRevolve: WorkplaneShape["sketchRevolve"], targetShape?: WorkplaneShape): ShapeHandle;
|
|
175
|
+
/** Rebuild the exact CAD representation of an eligible retained revolve. */
|
|
176
|
+
export declare function exactPlainSketchRevolveResult(shape: WorkplaneShape): Promise<ServerCadResult>;
|
|
132
177
|
/**
|
|
133
178
|
* Apply a prism draft along the shape's vertical extrusion axis.
|
|
134
179
|
*
|
|
@@ -139,8 +184,13 @@ export declare function applyEdgeTreatment(shape: WorkplaneShape, treatment: Ser
|
|
|
139
184
|
export declare function applyDraftPrism(shape: WorkplaneShape, request: {
|
|
140
185
|
angle: number;
|
|
141
186
|
}): Promise<ServerCadResult>;
|
|
187
|
+
/** Apply one face draft to a retained exact sketch extrusion or sweep using the current stable face ID. */
|
|
188
|
+
export declare function applySketchFaceDraft(shape: WorkplaneShape, request: SketchFaceDraftRequest): Promise<ServerCadResult>;
|
|
142
189
|
/** The exact geometry and a mesh of it, which is what a shape stores after any CAD operation. */
|
|
143
|
-
export declare function meshedCadResult(cad: OcctKernel, result: ShapeHandle, sourceShape?: WorkplaneShape
|
|
190
|
+
export declare function meshedCadResult(cad: OcctKernel, result: ShapeHandle, sourceShape?: WorkplaneShape, lineage?: {
|
|
191
|
+
sourceFaceHashes: number[];
|
|
192
|
+
evolution: EvolutionData;
|
|
193
|
+
}): ServerCadResult;
|
|
144
194
|
/**
|
|
145
195
|
* The shape as it stands after a treatment.
|
|
146
196
|
*
|
|
@@ -151,4 +201,5 @@ export declare function meshedCadResult(cad: OcctKernel, result: ShapeHandle, so
|
|
|
151
201
|
* the viewport expects -- so the shape keeps its place on the workplane.
|
|
152
202
|
*/
|
|
153
203
|
export declare function shapeWithCadResult(shape: WorkplaneShape, result: ServerCadResult): WorkplaneShape;
|
|
204
|
+
export {};
|
|
154
205
|
//# sourceMappingURL=serverCadOperations.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"serverCadOperations.d.ts","sourceRoot":"","sources":["../src/serverCadOperations.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"serverCadOperations.d.ts","sourceRoot":"","sources":["../src/serverCadOperations.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH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AAE,aAAa,EAC5B,aAAa,EAAE,cAAc,CAAC,eAAe,CAAC,EAC9C,WAAW,CAAC,EAAE,cAAc,eAqD7B;AAoBD,4EAA4E;AAC5E,wBAAgB,6BAA6B,CAAC,KAAK,EAAE,cAAc,GAAG,OAAO,CAAC,eAAe,CAAC,CAQ7F;AAED;;;;;;GAMG;AACH,wBAAgB,eAAe,CAAC,KAAK,EAAE,cAAc,EAAE,OAAO,EAAE;IAAE,KAAK,EAAE,MAAM,CAAA;CAAE,GAAG,OAAO,CAAC,eAAe,CAAC,CA6C3G;AAED,2GAA2G;AAC3G,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,cAAc,EAAE,OAAO,EAAE,sBAAsB,GAAG,OAAO,CAAC,eAAe,CAAC,CA2DrH;AAiCD,iGAAiG;AACjG,wBAAgB,eAAe,CAC7B,GAAG,EAAE,UAAU,EACf,MAAM,EAAE,WAAW,EACnB,WAAW,CAAC,EAAE,cAAc,EAC5B,OAAO,CAAC,EAAE;IAAE,gBAAgB,EAAE,MAAM,EAAE,CAAC;IAAC,SAAS,EAAE,aAAa,CAAA;CAAE,GACjE,eAAe,CAqCjB;AAyDD;;;;;;;;GAQG;AACH,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,cAAc,EAAE,MAAM,EAAE,eAAe,GAAG,cAAc,CAiGjG"}
|
|
@@ -14,10 +14,13 @@
|
|
|
14
14
|
* the result format, so a shape filleted here is indistinguishable in the
|
|
15
15
|
* editor from one filleted there.
|
|
16
16
|
*/
|
|
17
|
+
import { faceIdsFromEvolution } from "./faceLineage.js";
|
|
17
18
|
import { withCadKernel } from "./serverCadKernel.js";
|
|
18
19
|
import { exactSolidForShape, shapeIsTurned, unrotatedSolidForShape, UnbuildableShapeError, EXACT_SOLID_KINDS, } from "./cadSolids.js";
|
|
19
20
|
import { canonicalizeShape } from "./workplaneShapes.js";
|
|
20
21
|
import { createLocalId } from "./localIds.js";
|
|
22
|
+
import { cadSketchRegions } from "./sketchCadProfile.js";
|
|
23
|
+
import { sketchProfileToRevolvePolygons } from "./sketchRevolve.js";
|
|
21
24
|
export class ServerCadError extends Error {
|
|
22
25
|
status;
|
|
23
26
|
constructor(message, status = 422) {
|
|
@@ -28,6 +31,11 @@ export class ServerCadError extends Error {
|
|
|
28
31
|
}
|
|
29
32
|
const MESH_DEFLECTION = 0.1;
|
|
30
33
|
const MIN_CAD_DIMENSION = 0.01;
|
|
34
|
+
const FACE_HASH_UPPER_BOUND = 2_147_483_647;
|
|
35
|
+
const DRAFT_PULL_AXES = {
|
|
36
|
+
x: { x: 1, y: 0, z: 0 }, y: { x: 0, y: 1, z: 0 }, z: { x: 0, y: 0, z: 1 },
|
|
37
|
+
"-x": { x: -1, y: 0, z: 0 }, "-y": { x: 0, y: -1, z: 0 }, "-z": { x: 0, y: 0, z: -1 },
|
|
38
|
+
};
|
|
31
39
|
function meshPositionsOf(shape) {
|
|
32
40
|
const positions = shape.importedMesh?.positions;
|
|
33
41
|
return positions && positions.length >= 9 ? positions : null;
|
|
@@ -331,7 +339,7 @@ export function applyEdgeTreatment(shape, treatment) {
|
|
|
331
339
|
return Promise.reject(new ServerCadError("The fillet radius or chamfer distance must be greater than zero.", 400));
|
|
332
340
|
}
|
|
333
341
|
return withCadKernel((cad) => {
|
|
334
|
-
const solid =
|
|
342
|
+
const solid = edgeTreatmentSolid(cad, shape, treatment);
|
|
335
343
|
const allEdges = cad.getSubShapes(solid, "edge");
|
|
336
344
|
const requested = treatment.edges;
|
|
337
345
|
if (requested?.some((index) => !Number.isInteger(index) || index < 0 || index >= allEdges.length)) {
|
|
@@ -348,13 +356,18 @@ export function applyEdgeTreatment(shape, treatment) {
|
|
|
348
356
|
if (edges.length === 0) {
|
|
349
357
|
throw new ServerCadError("None of those edges can be rounded: they are seams in a curved surface rather than corners. Check `filletable` in the edge listing.", 400);
|
|
350
358
|
}
|
|
359
|
+
const sourceFaces = cad.getSubShapes(solid, "face");
|
|
360
|
+
const sourceFaceHashes = sourceFaces.map((face) => cad.hashCode(face, FACE_HASH_UPPER_BOUND));
|
|
351
361
|
let treated;
|
|
362
|
+
let evolution;
|
|
352
363
|
try {
|
|
353
364
|
if (treatment.kind === "fillet") {
|
|
354
|
-
|
|
365
|
+
evolution = cad.filletWithHistory(solid, edges, treatment.amount, sourceFaceHashes, FACE_HASH_UPPER_BOUND);
|
|
366
|
+
treated = evolution.result;
|
|
355
367
|
}
|
|
356
368
|
else if (treatment.angle === undefined || Math.abs(treatment.angle - 45) < 0.001) {
|
|
357
|
-
|
|
369
|
+
evolution = cad.chamferWithHistory(solid, edges, treatment.amount, sourceFaceHashes, FACE_HASH_UPPER_BOUND);
|
|
370
|
+
treated = evolution.result;
|
|
358
371
|
}
|
|
359
372
|
else {
|
|
360
373
|
treated = cad.chamferDistAngle(solid, edges, treatment.amount, treatment.angle);
|
|
@@ -373,7 +386,112 @@ export function applyEdgeTreatment(shape, treatment) {
|
|
|
373
386
|
// no visible reason. Unwrap the single solid inside it.
|
|
374
387
|
const treatedSolids = cad.getSubShapes(treated, "solid");
|
|
375
388
|
const result = treatedSolids.length === 1 ? treatedSolids[0] : treated;
|
|
376
|
-
return meshedCadResult(cad, result, shape);
|
|
389
|
+
return meshedCadResult(cad, result, shape, evolution ? { sourceFaceHashes, evolution } : undefined);
|
|
390
|
+
});
|
|
391
|
+
}
|
|
392
|
+
/** Count currently chamferable/filletable edges without preserving topology indexes. */
|
|
393
|
+
export function allEdgeTreatmentEdgeCount(shape, kind) {
|
|
394
|
+
return withCadKernel((cad) => {
|
|
395
|
+
const solid = edgeTreatmentSolid(cad, shape, { kind, amount: 1 });
|
|
396
|
+
return cad.getSubShapes(solid, "edge").filter((edge) => adjacentFaceCount(cad, solid, edge) >= 2).length;
|
|
397
|
+
});
|
|
398
|
+
}
|
|
399
|
+
function edgeTreatmentSolid(cad, shape, treatment) {
|
|
400
|
+
if (treatment.kind === "chamfer" && !treatment.edges?.length
|
|
401
|
+
&& shape.sketchOperation === "revolve" && shape.sketchProfile && !shape.faceDraft) {
|
|
402
|
+
return exactPlainSketchRevolveSolid(cad, shape.sketchProfile, shape.sketchRevolve, shape);
|
|
403
|
+
}
|
|
404
|
+
return orientedSolidForShape(cad, shape);
|
|
405
|
+
}
|
|
406
|
+
/** Build the analytical full-turn BREP for chamfering a retained plain revolve. */
|
|
407
|
+
export function isPlainFullTurnSketchRevolve(shape) {
|
|
408
|
+
const settings = shape.sketchRevolve;
|
|
409
|
+
return shape.sketchOperation === "revolve" && Boolean(shape.sketchProfile) && Boolean(settings)
|
|
410
|
+
&& (settings.pitch ?? 0) === 0 && (settings.coreRadius ?? 0) === 0
|
|
411
|
+
&& Math.abs(Math.abs(settings.sweepAngle) - 360) <= 1e-6;
|
|
412
|
+
}
|
|
413
|
+
/** Build the analytical BREP for a plain, single-region full-turn revolve. */
|
|
414
|
+
export function exactPlainSketchRevolveSolid(cad, sketchProfile, sketchRevolve, targetShape) {
|
|
415
|
+
if (!sketchRevolve || (sketchRevolve.pitch ?? 0) !== 0 || (sketchRevolve.coreRadius ?? 0) !== 0
|
|
416
|
+
|| Math.abs(Math.abs(sketchRevolve.sweepAngle) - 360) > 1e-6) {
|
|
417
|
+
throw new ServerCadError("Exact face drafting requires a plain full-turn sketch revolve.");
|
|
418
|
+
}
|
|
419
|
+
const polygons = sketchProfileToRevolvePolygons(sketchProfile, sketchRevolve);
|
|
420
|
+
if (polygons.length === 0)
|
|
421
|
+
throw new ServerCadError("The retained revolve profile has no closed region.");
|
|
422
|
+
const profile = {
|
|
423
|
+
points: polygons.flatMap((polygon, polygonIndex) => polygon.map(([x, z], pointIndex) => ({
|
|
424
|
+
id: `revolve-${polygonIndex}-point-${pointIndex}`,
|
|
425
|
+
x,
|
|
426
|
+
z,
|
|
427
|
+
}))),
|
|
428
|
+
segments: polygons.flatMap((polygon, polygonIndex) => polygon.map((_, pointIndex) => ({
|
|
429
|
+
id: `revolve-${polygonIndex}-segment-${pointIndex}`,
|
|
430
|
+
startId: `revolve-${polygonIndex}-point-${pointIndex}`,
|
|
431
|
+
endId: `revolve-${polygonIndex}-point-${(pointIndex + 1) % polygon.length}`,
|
|
432
|
+
kind: "line",
|
|
433
|
+
}))),
|
|
434
|
+
};
|
|
435
|
+
const pathWire = (path) => cad.makeWire(path.steps.map(({ from, to }) => cad.makeLineEdge({ x: from.x, y: from.z, z: 0 }, { x: to.x, y: to.z, z: 0 })));
|
|
436
|
+
const regions = cadSketchRegions(profile);
|
|
437
|
+
if (regions.length !== 1)
|
|
438
|
+
throw new ServerCadError("Exact face drafting requires one closed revolve profile region.");
|
|
439
|
+
const solids = regions.map((region) => {
|
|
440
|
+
let face = cad.makeFace(pathWire(region.outer));
|
|
441
|
+
if (region.holes.length)
|
|
442
|
+
face = cad.addHolesInFace(face, region.holes.map(pathWire));
|
|
443
|
+
const solid = cad.revolve(face, {
|
|
444
|
+
point: { x: 0, y: 0, z: 0 },
|
|
445
|
+
direction: { x: 0, y: 1, z: 0 },
|
|
446
|
+
}, Math.PI * 2);
|
|
447
|
+
return Math.abs(sketchRevolve.startAngle) < 1e-8 ? solid : cad.rotate(solid, {
|
|
448
|
+
point: { x: 0, y: 0, z: 0 },
|
|
449
|
+
direction: { x: 0, y: 1, z: 0 },
|
|
450
|
+
}, (sketchRevolve.startAngle * Math.PI) / 180);
|
|
451
|
+
});
|
|
452
|
+
let solid = solids[0];
|
|
453
|
+
if (targetShape?.importedMesh && targetShape.width > 0 && targetShape.depth > 0 && targetShape.height > 0) {
|
|
454
|
+
const bounds = cad.getBoundingBox(solid, false);
|
|
455
|
+
const sx = targetShape.width / Math.max(bounds.xmax - bounds.xmin, 1e-9);
|
|
456
|
+
const sy = targetShape.height / Math.max(bounds.ymax - bounds.ymin, 1e-9);
|
|
457
|
+
const sz = targetShape.depth / Math.max(bounds.zmax - bounds.zmin, 1e-9);
|
|
458
|
+
solid = cad.transform(solid, [
|
|
459
|
+
sx, 0, 0, -(bounds.xmin + bounds.xmax) * sx / 2,
|
|
460
|
+
0, sy, 0, -bounds.ymin * sy,
|
|
461
|
+
0, 0, sz, -(bounds.zmin + bounds.zmax) * sz / 2,
|
|
462
|
+
]);
|
|
463
|
+
}
|
|
464
|
+
if (!cad.isValid(solid) || !cad.isSolid(solid))
|
|
465
|
+
throw new ServerCadError("The retained sketch revolve could not be rebuilt as exact CAD geometry.");
|
|
466
|
+
return solid;
|
|
467
|
+
}
|
|
468
|
+
function scaleRevolveResult(cad, solid, shape) {
|
|
469
|
+
const mesh = shape.importedMesh;
|
|
470
|
+
if (!mesh)
|
|
471
|
+
return solid;
|
|
472
|
+
const factors = [
|
|
473
|
+
shape.width / Math.max(mesh.baseWidth ?? shape.width, 1e-9),
|
|
474
|
+
shape.height / Math.max(mesh.baseHeight ?? shape.height, 1e-9),
|
|
475
|
+
shape.depth / Math.max(mesh.baseDepth ?? shape.depth, 1e-9),
|
|
476
|
+
];
|
|
477
|
+
if (factors.every((factor) => Math.abs(factor - 1) < 1e-8))
|
|
478
|
+
return solid;
|
|
479
|
+
const bounds = cad.getBoundingBox(solid, false);
|
|
480
|
+
const [sx, sy, sz] = factors;
|
|
481
|
+
return cad.transform(solid, [
|
|
482
|
+
sx, 0, 0, -(bounds.xmin + bounds.xmax) * sx / 2,
|
|
483
|
+
0, sy, 0, -bounds.ymin * sy,
|
|
484
|
+
0, 0, sz, -(bounds.zmin + bounds.zmax) * sz / 2,
|
|
485
|
+
]);
|
|
486
|
+
}
|
|
487
|
+
/** Rebuild the exact CAD representation of an eligible retained revolve. */
|
|
488
|
+
export function exactPlainSketchRevolveResult(shape) {
|
|
489
|
+
if (!shape.sketchProfile || !isPlainFullTurnSketchRevolve(shape)) {
|
|
490
|
+
return Promise.reject(new ServerCadError("Exact revolve geometry requires a plain full-turn retained sketch revolve."));
|
|
491
|
+
}
|
|
492
|
+
return withCadKernel((cad) => {
|
|
493
|
+
const solid = exactPlainSketchRevolveSolid(cad, shape.sketchProfile, shape.sketchRevolve, shape);
|
|
494
|
+
return { ...meshedCadResult(cad, solid), faceIds: freshFaceIds(cad, solid, shape.id) };
|
|
377
495
|
});
|
|
378
496
|
}
|
|
379
497
|
/**
|
|
@@ -426,8 +544,104 @@ export function applyDraftPrism(shape, request) {
|
|
|
426
544
|
return { ...meshed, faceIds: freshFaceIds(cad, result, shape.id) };
|
|
427
545
|
});
|
|
428
546
|
}
|
|
547
|
+
/** Apply one face draft to a retained exact sketch extrusion or sweep using the current stable face ID. */
|
|
548
|
+
export function applySketchFaceDraft(shape, request) {
|
|
549
|
+
if (!Number.isFinite(request.angle) || request.angle === 0 || Math.abs(request.angle) >= 45) {
|
|
550
|
+
return Promise.reject(new ServerCadError("The face draft angle must be non-zero and between -45 and 45 degrees.", 400));
|
|
551
|
+
}
|
|
552
|
+
const exactRevolve = isPlainFullTurnSketchRevolve(shape);
|
|
553
|
+
if ((!exactRevolve && shape.sketchOperation !== "extrude" && shape.sketchOperation !== "sweep")
|
|
554
|
+
|| !shape.sketchProfile || (!shape.cadBrep && !exactRevolve)) {
|
|
555
|
+
return Promise.reject(new ServerCadError("Face drafts require an exact retained sketch extrusion, sweep, or plain full-turn revolve.", 400));
|
|
556
|
+
}
|
|
557
|
+
return withCadKernel((cad) => {
|
|
558
|
+
const solid = exactRevolve
|
|
559
|
+
? exactPlainSketchRevolveSolid(cad, shape.sketchProfile, shape.sketchRevolve, shape)
|
|
560
|
+
: solidFromBrep(cad, shape.cadBrep);
|
|
561
|
+
const faces = cad.getSubShapes(solid, "face");
|
|
562
|
+
const ids = shape.faceIds?.length === faces.length ? shape.faceIds
|
|
563
|
+
: exactRevolve && !shape.faceColors ? faces.map((_, index) => `face_${encodeURIComponent(shape.id)}_${index}`)
|
|
564
|
+
: undefined;
|
|
565
|
+
if (!ids || ids.length !== faces.length || new Set(ids).size !== faces.length) {
|
|
566
|
+
throw new ServerCadError("Face drafting requires a complete, unique stable face ID list.");
|
|
567
|
+
}
|
|
568
|
+
const selected = ids.flatMap((id, index) => id === request.sourceFaceId ? [index] : []);
|
|
569
|
+
if (selected.length !== 1)
|
|
570
|
+
throw new ServerCadError("The selected source face is no longer available.");
|
|
571
|
+
const face = faces[selected[0]];
|
|
572
|
+
if (!face)
|
|
573
|
+
throw new ServerCadError("The selected source face is no longer available.");
|
|
574
|
+
const direction = DRAFT_PULL_AXES[request.pullDirection];
|
|
575
|
+
const angle = request.angle * Math.PI / 180;
|
|
576
|
+
let drafted;
|
|
577
|
+
try {
|
|
578
|
+
drafted = cad.draft(solid, face, angle, direction);
|
|
579
|
+
}
|
|
580
|
+
catch {
|
|
581
|
+
const rotation = canonicalDraftRotation(request.pullDirection);
|
|
582
|
+
try {
|
|
583
|
+
if (!rotation)
|
|
584
|
+
throw new Error("No canonical rotation for the selected pull axis.");
|
|
585
|
+
const rotatedSolid = cad.rotate(solid, rotation.axis, rotation.angle);
|
|
586
|
+
const oldNormal = faceNormal(cad, face);
|
|
587
|
+
if (!oldNormal)
|
|
588
|
+
throw new Error("The selected face has no usable normal.");
|
|
589
|
+
const targetNormal = rotateVector(oldNormal, rotation.axis.direction, rotation.angle);
|
|
590
|
+
const targetCenter = rotateVector(cad.getSurfaceCenterOfMass(face), rotation.axis.direction, rotation.angle);
|
|
591
|
+
const bounds = cad.getBoundingBox(solid, false);
|
|
592
|
+
const scale = Math.max(1, Math.hypot(bounds.xmax - bounds.xmin, bounds.ymax - bounds.ymin, bounds.zmax - bounds.zmin));
|
|
593
|
+
const matches = cad.getSubShapes(rotatedSolid, "face").filter((candidate) => {
|
|
594
|
+
const normal = faceNormal(cad, candidate);
|
|
595
|
+
const center = cad.getSurfaceCenterOfMass(candidate);
|
|
596
|
+
return normal && Math.hypot(normal.x - targetNormal.x, normal.y - targetNormal.y, normal.z - targetNormal.z) <= 1e-7
|
|
597
|
+
&& Math.hypot(center.x - targetCenter.x, center.y - targetCenter.y, center.z - targetCenter.z) <= scale * 1e-8;
|
|
598
|
+
});
|
|
599
|
+
if (matches.length !== 1)
|
|
600
|
+
throw new Error("Could not uniquely identify the selected face after rotating the solid.");
|
|
601
|
+
const canonicalDraft = cad.draft(rotatedSolid, matches[0], angle, { x: 0, y: 0, z: 1 });
|
|
602
|
+
drafted = cad.rotate(canonicalDraft, rotation.axis, -rotation.angle);
|
|
603
|
+
}
|
|
604
|
+
catch {
|
|
605
|
+
throw new ServerCadError("The selected source face cannot be drafted along that local pull axis and angle.");
|
|
606
|
+
}
|
|
607
|
+
}
|
|
608
|
+
if (!cadResultIsValid(cad, drafted) || !cad.isSolid(drafted)) {
|
|
609
|
+
throw new ServerCadError("The face draft did not produce a valid solid.");
|
|
610
|
+
}
|
|
611
|
+
return meshedCadResult(cad, exactRevolve ? scaleRevolveResult(cad, drafted, shape) : drafted, shape);
|
|
612
|
+
});
|
|
613
|
+
}
|
|
614
|
+
function canonicalDraftRotation(direction) {
|
|
615
|
+
switch (direction) {
|
|
616
|
+
case "x": return { axis: { point: { x: 0, y: 0, z: 0 }, direction: { x: 0, y: 1, z: 0 } }, angle: -Math.PI / 2 };
|
|
617
|
+
case "-x": return { axis: { point: { x: 0, y: 0, z: 0 }, direction: { x: 0, y: 1, z: 0 } }, angle: Math.PI / 2 };
|
|
618
|
+
case "y": return { axis: { point: { x: 0, y: 0, z: 0 }, direction: { x: 1, y: 0, z: 0 } }, angle: Math.PI / 2 };
|
|
619
|
+
case "-y": return { axis: { point: { x: 0, y: 0, z: 0 }, direction: { x: 1, y: 0, z: 0 } }, angle: -Math.PI / 2 };
|
|
620
|
+
case "z": return null;
|
|
621
|
+
case "-z": return { axis: { point: { x: 0, y: 0, z: 0 }, direction: { x: 0, y: 1, z: 0 } }, angle: Math.PI };
|
|
622
|
+
}
|
|
623
|
+
}
|
|
624
|
+
function rotateVector(vector, axis, angle) {
|
|
625
|
+
const cosine = Math.cos(angle), sine = Math.sin(angle);
|
|
626
|
+
const dot = axis.x * vector.x + axis.y * vector.y + axis.z * vector.z;
|
|
627
|
+
const cross = { x: axis.y * vector.z - axis.z * vector.y, y: axis.z * vector.x - axis.x * vector.z, z: axis.x * vector.y - axis.y * vector.x };
|
|
628
|
+
return {
|
|
629
|
+
x: vector.x * cosine + cross.x * sine + axis.x * dot * (1 - cosine),
|
|
630
|
+
y: vector.y * cosine + cross.y * sine + axis.y * dot * (1 - cosine),
|
|
631
|
+
z: vector.z * cosine + cross.z * sine + axis.z * dot * (1 - cosine),
|
|
632
|
+
};
|
|
633
|
+
}
|
|
634
|
+
function faceNormal(cad, face) {
|
|
635
|
+
try {
|
|
636
|
+
const bounds = cad.uvBounds(face);
|
|
637
|
+
return cad.surfaceNormal(face, (bounds.uMin + bounds.uMax) / 2, (bounds.vMin + bounds.vMax) / 2);
|
|
638
|
+
}
|
|
639
|
+
catch {
|
|
640
|
+
return null;
|
|
641
|
+
}
|
|
642
|
+
}
|
|
429
643
|
/** The exact geometry and a mesh of it, which is what a shape stores after any CAD operation. */
|
|
430
|
-
export function meshedCadResult(cad, result, sourceShape) {
|
|
644
|
+
export function meshedCadResult(cad, result, sourceShape, lineage) {
|
|
431
645
|
const mesh = cad.meshShape(result, { linearDeflection: MESH_DEFLECTION });
|
|
432
646
|
// The editor stores a flat triangle list, not an indexed mesh, so the
|
|
433
647
|
// indices are expanded here rather than carried.
|
|
@@ -446,7 +660,11 @@ export function meshedCadResult(cad, result, sourceShape) {
|
|
|
446
660
|
if (index !== undefined)
|
|
447
661
|
faceGroups.push(mesh.faceGroups[group], mesh.faceGroups[group + 1], index);
|
|
448
662
|
}
|
|
449
|
-
const faceIds = sourceShape
|
|
663
|
+
const faceIds = sourceShape
|
|
664
|
+
? lineage
|
|
665
|
+
? faceIdsFromEvolution(sourceShape.id, sourceShape.faceIds, lineage.sourceFaceHashes, faces.map((face) => cad.hashCode(face, FACE_HASH_UPPER_BOUND)), lineage.evolution)
|
|
666
|
+
: faceIdsForResult(cad, sourceShape, faces)
|
|
667
|
+
: undefined;
|
|
450
668
|
return {
|
|
451
669
|
brep: cad.toBREP(result),
|
|
452
670
|
positions,
|