fluidcad 0.0.14 → 0.0.15
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/lib/dist/common/scene-object.d.ts +3 -0
- package/lib/dist/common/scene-object.js +7 -0
- package/lib/dist/core/2d/arc.d.ts +14 -56
- package/lib/dist/core/2d/arc.js +8 -23
- package/lib/dist/core/2d/center.d.ts +9 -0
- package/lib/dist/core/2d/center.js +10 -0
- package/lib/dist/core/2d/index.d.ts +2 -0
- package/lib/dist/core/2d/index.js +2 -0
- package/lib/dist/core/2d/intersect.d.ts +17 -0
- package/lib/dist/core/2d/intersect.js +20 -0
- package/lib/dist/core/interfaces.d.ts +50 -2
- package/lib/dist/core/repeat.js +10 -3
- package/lib/dist/features/2d/arc.d.ts +27 -14
- package/lib/dist/features/2d/arc.js +269 -38
- package/lib/dist/features/2d/intersect.d.ts +15 -0
- package/lib/dist/features/2d/intersect.js +83 -0
- package/lib/dist/features/2d/plane-center.d.ts +13 -0
- package/lib/dist/features/2d/plane-center.js +40 -0
- package/lib/dist/features/2d/projection.js +3 -4
- package/lib/dist/features/2d/rect.d.ts +2 -2
- package/lib/dist/features/2d/rect.js +3 -3
- package/lib/dist/features/2d/sketch.d.ts +2 -2
- package/lib/dist/features/2d/sketch.js +13 -1
- package/lib/dist/features/2d/slot.d.ts +2 -2
- package/lib/dist/features/2d/slot.js +3 -3
- package/lib/dist/features/extrude-base.d.ts +4 -0
- package/lib/dist/features/extrude-base.js +27 -0
- package/lib/dist/features/extrude-to-face.d.ts +1 -0
- package/lib/dist/features/extrude-to-face.js +5 -1
- package/lib/dist/features/extrude-two-distances.d.ts +1 -0
- package/lib/dist/features/extrude-two-distances.js +5 -2
- package/lib/dist/features/extrude.d.ts +1 -0
- package/lib/dist/features/extrude.js +5 -1
- package/lib/dist/features/plane-renderable-base.d.ts +2 -1
- package/lib/dist/features/plane-renderable-base.js +1 -1
- package/lib/dist/features/plane.d.ts +1 -1
- package/lib/dist/filters/face/face-filter.d.ts +10 -0
- package/lib/dist/filters/face/face-filter.js +39 -0
- package/lib/dist/filters/face/intersects-with.d.ts +18 -0
- package/lib/dist/filters/face/intersects-with.js +41 -0
- package/lib/dist/helpers/clone-transform.js +1 -0
- package/lib/dist/oc/boolean-ops.js +0 -2
- package/lib/dist/oc/face-query.d.ts +1 -0
- package/lib/dist/oc/face-query.js +15 -0
- package/lib/dist/oc/index.d.ts +1 -0
- package/lib/dist/oc/index.js +1 -0
- package/lib/dist/oc/section-ops.d.ts +6 -0
- package/lib/dist/oc/section-ops.js +26 -0
- package/lib/dist/oc/thin-face-maker.d.ts +29 -0
- package/lib/dist/oc/thin-face-maker.js +163 -0
- package/lib/dist/rendering/render.js +16 -0
- package/lib/dist/tests/features/2d/arc.test.js +2 -2
- package/lib/dist/tests/features/2d/intersect.test.d.ts +1 -0
- package/lib/dist/tests/features/2d/intersect.test.js +22 -0
- package/lib/dist/tests/features/2d/rect.test.js +1 -1
- package/lib/dist/tests/features/loft.test.js +1 -1
- package/lib/dist/tests/features/select.test.js +49 -1
- package/lib/dist/tests/features/thin-extrude.test.d.ts +1 -0
- package/lib/dist/tests/features/thin-extrude.test.js +137 -0
- package/lib/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +3 -3
- package/ui/dist/assets/{index-mLcpjEcV.js → index-BJG141m7.js} +2 -2
- package/ui/dist/index.html +1 -1
- package/lib/dist/features/2d/arc-three-points.d.ts +0 -19
- package/lib/dist/features/2d/arc-three-points.js +0 -75
- package/lib/dist/features/2d/arc-to-point.d.ts +0 -17
- package/lib/dist/features/2d/arc-to-point.js +0 -95
|
@@ -27,6 +27,7 @@ export declare abstract class SceneObject implements Comparable<SceneObject>, Se
|
|
|
27
27
|
private _id;
|
|
28
28
|
private _order;
|
|
29
29
|
private _transform;
|
|
30
|
+
private _cloneSource;
|
|
30
31
|
private _parent;
|
|
31
32
|
private _alwaysVisible;
|
|
32
33
|
private _name;
|
|
@@ -60,6 +61,8 @@ export declare abstract class SceneObject implements Comparable<SceneObject>, Se
|
|
|
60
61
|
clone(): SceneObject[];
|
|
61
62
|
setTransform(matrix: Matrix4): void;
|
|
62
63
|
getTransform(): Matrix4 | null;
|
|
64
|
+
setCloneSource(source: SceneObject): void;
|
|
65
|
+
getCloneSource(): SceneObject | null;
|
|
63
66
|
getTransformMatrix(): Matrix4 | null;
|
|
64
67
|
isExtrudable(): boolean;
|
|
65
68
|
init(): void;
|
|
@@ -5,6 +5,7 @@ export class SceneObject {
|
|
|
5
5
|
_id;
|
|
6
6
|
_order = 0;
|
|
7
7
|
_transform = null;
|
|
8
|
+
_cloneSource = null;
|
|
8
9
|
_parent = null;
|
|
9
10
|
_alwaysVisible = false;
|
|
10
11
|
_name = null;
|
|
@@ -161,6 +162,12 @@ export class SceneObject {
|
|
|
161
162
|
getTransform() {
|
|
162
163
|
return this._transform;
|
|
163
164
|
}
|
|
165
|
+
setCloneSource(source) {
|
|
166
|
+
this._cloneSource = source;
|
|
167
|
+
}
|
|
168
|
+
getCloneSource() {
|
|
169
|
+
return this._cloneSource;
|
|
170
|
+
}
|
|
164
171
|
getTransformMatrix() {
|
|
165
172
|
return null;
|
|
166
173
|
}
|
|
@@ -1,84 +1,42 @@
|
|
|
1
1
|
import { Point2DLike } from "../../math/point.js";
|
|
2
2
|
import { PlaneLike } from "../../math/plane.js";
|
|
3
|
-
import {
|
|
3
|
+
import { IArcPoints, IArcAngles, ISceneObject } from "../interfaces.js";
|
|
4
4
|
interface ArcFunction {
|
|
5
5
|
/**
|
|
6
|
-
* Draws an arc to an end point
|
|
6
|
+
* Draws an arc to an end point from the current position.
|
|
7
|
+
* Chain `.radius(r)` to set bulge radius, or `.center(point)` to specify the circle center.
|
|
7
8
|
* @param endPoint - The end point of the arc
|
|
8
|
-
* @param radius - The bulge radius (0 = auto)
|
|
9
9
|
*/
|
|
10
|
-
(endPoint: Point2DLike
|
|
10
|
+
(endPoint: Point2DLike): IArcPoints;
|
|
11
11
|
/**
|
|
12
|
-
* Draws an arc from a start point to an end point
|
|
12
|
+
* Draws an arc from a start point to an end point.
|
|
13
|
+
* By default, uses the current position as the arc center.
|
|
14
|
+
* Chain `.radius(r)` to use bulge radius instead, or `.center(point)` to specify an explicit center.
|
|
13
15
|
* @param startPoint - The start point of the arc
|
|
14
16
|
* @param endPoint - The end point of the arc
|
|
15
|
-
* @param radius - The bulge radius (0 = auto)
|
|
16
17
|
*/
|
|
17
|
-
(startPoint: Point2DLike, endPoint: Point2DLike
|
|
18
|
+
(startPoint: Point2DLike, endPoint: Point2DLike): IArcPoints;
|
|
18
19
|
/**
|
|
19
|
-
* Draws an arc by radius and angle range.
|
|
20
|
+
* Draws an arc by radius and angle range at the current position.
|
|
21
|
+
* Chain `.centered()` to center the arc symmetrically around the start angle.
|
|
20
22
|
* @param radius - The arc radius
|
|
21
23
|
* @param startAngle - The start angle in degrees (defaults to 0)
|
|
22
24
|
* @param endAngle - The end angle in degrees (defaults to 180)
|
|
23
|
-
* @param centered - Whether to center the arc on the current position
|
|
24
25
|
*/
|
|
25
|
-
(radius: number, startAngle?: number, endAngle?: number
|
|
26
|
-
/**
|
|
27
|
-
* Draws an arc from a start point to an end point around a center point.
|
|
28
|
-
* @param startPoint - The start point of the arc
|
|
29
|
-
* @param endPoint - The end point of the arc
|
|
30
|
-
* @param center - The center point of the arc
|
|
31
|
-
*/
|
|
32
|
-
(startPoint: Point2DLike, endPoint: Point2DLike, center: Point2DLike): IGeometry;
|
|
26
|
+
(radius: number, startAngle?: number, endAngle?: number): IArcAngles;
|
|
33
27
|
/**
|
|
34
28
|
* Draws an arc to an end point on a specific plane.
|
|
35
29
|
* @param endPoint - The end point of the arc
|
|
36
30
|
* @param targetPlane - The plane to draw on
|
|
37
31
|
*/
|
|
38
|
-
(endPoint: Point2DLike, targetPlane: PlaneLike | ISceneObject):
|
|
39
|
-
/**
|
|
40
|
-
* Draws an arc to an end point with a bulge radius on a specific plane.
|
|
41
|
-
* @param endPoint - The end point of the arc
|
|
42
|
-
* @param radius - The bulge radius
|
|
43
|
-
* @param targetPlane - The plane to draw on
|
|
44
|
-
*/
|
|
45
|
-
(endPoint: Point2DLike, radius: number, targetPlane: PlaneLike | ISceneObject): IGeometry;
|
|
32
|
+
(endPoint: Point2DLike, targetPlane: PlaneLike | ISceneObject): IArcPoints;
|
|
46
33
|
/**
|
|
47
34
|
* Draws an arc between two points on a specific plane.
|
|
48
35
|
* @param startPoint - The start point of the arc
|
|
49
36
|
* @param endPoint - The end point of the arc
|
|
50
37
|
* @param targetPlane - The plane to draw on
|
|
51
38
|
*/
|
|
52
|
-
(startPoint: Point2DLike, endPoint: Point2DLike, targetPlane: PlaneLike | ISceneObject):
|
|
53
|
-
/**
|
|
54
|
-
* Draws an arc between two points with a bulge radius on a specific plane.
|
|
55
|
-
* @param startPoint - The start point of the arc
|
|
56
|
-
* @param endPoint - The end point of the arc
|
|
57
|
-
* @param radius - The bulge radius
|
|
58
|
-
* @param targetPlane - The plane to draw on
|
|
59
|
-
*/
|
|
60
|
-
(startPoint: Point2DLike, endPoint: Point2DLike, radius: number, targetPlane: PlaneLike | ISceneObject): IGeometry;
|
|
61
|
-
/**
|
|
62
|
-
* Draws an arc from a start point to an end point around a center point on a specific plane.
|
|
63
|
-
* @param startPoint - The start point of the arc
|
|
64
|
-
* @param endPoint - The end point of the arc
|
|
65
|
-
* @param center - The center point of the arc
|
|
66
|
-
* @param targetPlane - The plane to draw on
|
|
67
|
-
*/
|
|
68
|
-
(startPoint: Point2DLike, endPoint: Point2DLike, center: Point2DLike, targetPlane: PlaneLike | ISceneObject): IGeometry;
|
|
69
|
-
/**
|
|
70
|
-
* Draws an arc by radius on a specific plane.
|
|
71
|
-
* @param radius - The arc radius
|
|
72
|
-
* @param targetPlane - The plane to draw on
|
|
73
|
-
*/
|
|
74
|
-
(radius: number, targetPlane: PlaneLike | ISceneObject): IGeometry;
|
|
75
|
-
/**
|
|
76
|
-
* Draws an arc by radius and start angle on a specific plane.
|
|
77
|
-
* @param radius - The arc radius
|
|
78
|
-
* @param startAngle - The start angle in degrees
|
|
79
|
-
* @param targetPlane - The plane to draw on
|
|
80
|
-
*/
|
|
81
|
-
(radius: number, startAngle: number, targetPlane: PlaneLike | ISceneObject): IGeometry;
|
|
39
|
+
(startPoint: Point2DLike, endPoint: Point2DLike, targetPlane: PlaneLike | ISceneObject): IArcPoints;
|
|
82
40
|
/**
|
|
83
41
|
* Draws an arc by radius and angle range on a specific plane.
|
|
84
42
|
* @param radius - The arc radius
|
|
@@ -86,7 +44,7 @@ interface ArcFunction {
|
|
|
86
44
|
* @param endAngle - The end angle in degrees
|
|
87
45
|
* @param targetPlane - The plane to draw on
|
|
88
46
|
*/
|
|
89
|
-
(radius: number, startAngle: number, endAngle: number, targetPlane: PlaneLike | ISceneObject):
|
|
47
|
+
(radius: number, startAngle: number, endAngle: number, targetPlane: PlaneLike | ISceneObject): IArcAngles;
|
|
90
48
|
}
|
|
91
49
|
declare const _default: ArcFunction;
|
|
92
50
|
export default _default;
|
package/lib/dist/core/2d/arc.js
CHANGED
|
@@ -1,8 +1,5 @@
|
|
|
1
1
|
import { isPoint2DLike } from "../../math/point.js";
|
|
2
|
-
import {
|
|
3
|
-
import { ArcToPoint } from "../../features/2d/arc-to-point.js";
|
|
4
|
-
import { ArcThreePoints } from "../../features/2d/arc-three-points.js";
|
|
5
|
-
import { Move } from "../../features/2d/move.js";
|
|
2
|
+
import { Arc } from "../../features/2d/arc.js";
|
|
6
3
|
import { normalizePoint2D } from "../../helpers/normalize.js";
|
|
7
4
|
import { registerBuilder } from "../../index.js";
|
|
8
5
|
import { isPlaneLike } from "../../math/plane.js";
|
|
@@ -20,38 +17,26 @@ function build(context) {
|
|
|
20
17
|
argCount--;
|
|
21
18
|
}
|
|
22
19
|
}
|
|
23
|
-
// (startPoint, endPoint
|
|
24
|
-
if (argCount >= 3 && isPoint2DLike(arguments[0]) && isPoint2DLike(arguments[1]) && isPoint2DLike(arguments[2])) {
|
|
25
|
-
const start = normalizePoint2D(arguments[0]);
|
|
26
|
-
const end = normalizePoint2D(arguments[1]);
|
|
27
|
-
const center = normalizePoint2D(arguments[2]);
|
|
28
|
-
const arcObj = new ArcThreePoints(start, end, center, planeObj);
|
|
29
|
-
context.addSceneObjects([new Move(start), arcObj]);
|
|
30
|
-
return arcObj;
|
|
31
|
-
}
|
|
32
|
-
// (startPoint, endPoint, radius?) — two Point2DLike args
|
|
20
|
+
// (startPoint, endPoint) — two Point2DLike args, default center = current position
|
|
33
21
|
if (argCount >= 2 && isPoint2DLike(arguments[0]) && isPoint2DLike(arguments[1])) {
|
|
34
22
|
const start = normalizePoint2D(arguments[0]);
|
|
35
23
|
const end = normalizePoint2D(arguments[1]);
|
|
36
|
-
const
|
|
37
|
-
|
|
38
|
-
context.addSceneObjects([new Move(start), arcObj]);
|
|
24
|
+
const arcObj = Arc.twoPoints(start, end, planeObj);
|
|
25
|
+
context.addSceneObject(arcObj);
|
|
39
26
|
return arcObj;
|
|
40
27
|
}
|
|
41
|
-
// (endPoint
|
|
28
|
+
// (endPoint) — single Point2DLike arg
|
|
42
29
|
if (isPoint2DLike(arguments[0])) {
|
|
43
30
|
const end = normalizePoint2D(arguments[0]);
|
|
44
|
-
const
|
|
45
|
-
const arcObj = new ArcToPoint(end, radius, planeObj);
|
|
31
|
+
const arcObj = Arc.toPoint(end, planeObj);
|
|
46
32
|
context.addSceneObject(arcObj);
|
|
47
33
|
return arcObj;
|
|
48
34
|
}
|
|
49
|
-
// (radius, startAngle
|
|
35
|
+
// (radius, startAngle?, endAngle?) — all numeric args
|
|
50
36
|
const radius = arguments[0] || 100;
|
|
51
37
|
const startAngle = arguments[1] || 0;
|
|
52
38
|
const endAngle = argCount >= 3 ? arguments[2] : 180;
|
|
53
|
-
const
|
|
54
|
-
const arcObj = new ArcFromTwoAngles(radius, startAngle, endAngle, centered, planeObj);
|
|
39
|
+
const arcObj = Arc.fromAngles(radius, startAngle, endAngle, planeObj);
|
|
55
40
|
context.addSceneObject(arcObj);
|
|
56
41
|
return arcObj;
|
|
57
42
|
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { PlaneCenter } from "../../features/2d/plane-center.js";
|
|
2
|
+
import { registerBuilder } from "../../index.js";
|
|
3
|
+
function build(context) {
|
|
4
|
+
return function center() {
|
|
5
|
+
const planeCenter = new PlaneCenter();
|
|
6
|
+
context.addSceneObject(planeCenter);
|
|
7
|
+
return planeCenter;
|
|
8
|
+
};
|
|
9
|
+
}
|
|
10
|
+
export default registerBuilder(build);
|
|
@@ -18,4 +18,6 @@ export { default as connect } from './connect.js';
|
|
|
18
18
|
export { default as polygon } from './polygon.js';
|
|
19
19
|
export { default as offset } from './offset.js';
|
|
20
20
|
export { default as project } from './project.js';
|
|
21
|
+
export { default as intersect } from './intersect.js';
|
|
21
22
|
export { default as bezier } from './bezier.js';
|
|
23
|
+
export { default as center } from './center.js';
|
|
@@ -18,4 +18,6 @@ export { default as connect } from './connect.js';
|
|
|
18
18
|
export { default as polygon } from './polygon.js';
|
|
19
19
|
export { default as offset } from './offset.js';
|
|
20
20
|
export { default as project } from './project.js';
|
|
21
|
+
export { default as intersect } from './intersect.js';
|
|
21
22
|
export { default as bezier } from './bezier.js';
|
|
23
|
+
export { default as center } from './center.js';
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { PlaneLike } from "../../math/plane.js";
|
|
2
|
+
import { IExtrudableGeometry, ISceneObject } from "../interfaces.js";
|
|
3
|
+
interface IntersectFunction {
|
|
4
|
+
/**
|
|
5
|
+
* Intersects 3D objects with the current sketch plane, producing cross-section edges.
|
|
6
|
+
* @param sourceObjects - The 3D objects to intersect
|
|
7
|
+
*/
|
|
8
|
+
(...sourceObjects: ISceneObject[]): IExtrudableGeometry;
|
|
9
|
+
/**
|
|
10
|
+
* Intersects 3D objects with a target plane, producing cross-section edges.
|
|
11
|
+
* @param sourceObjects - The 3D objects to intersect
|
|
12
|
+
* @param targetPlane - The plane to intersect with
|
|
13
|
+
*/
|
|
14
|
+
(sourceObjects: ISceneObject[], targetPlane: PlaneLike | ISceneObject): IExtrudableGeometry;
|
|
15
|
+
}
|
|
16
|
+
declare const _default: IntersectFunction;
|
|
17
|
+
export default _default;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { Intersect } from "../../features/2d/intersect.js";
|
|
2
|
+
import { resolvePlane } from "../../helpers/resolve.js";
|
|
3
|
+
import { registerBuilder } from "../../index.js";
|
|
4
|
+
function build(context) {
|
|
5
|
+
return function intersect(...args) {
|
|
6
|
+
if (Array.isArray(args[0])) {
|
|
7
|
+
const sourceObjects = args[0];
|
|
8
|
+
context.addSceneObjects(sourceObjects);
|
|
9
|
+
const planeObj = resolvePlane(args[1], context);
|
|
10
|
+
const result = new Intersect(sourceObjects, planeObj);
|
|
11
|
+
context.addSceneObject(result);
|
|
12
|
+
return result;
|
|
13
|
+
}
|
|
14
|
+
const result = new Intersect(args);
|
|
15
|
+
context.addSceneObjects(args);
|
|
16
|
+
context.addSceneObject(result);
|
|
17
|
+
return result;
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
export default registerBuilder(build);
|
|
@@ -58,6 +58,26 @@ export interface IGeometry extends ISceneObject {
|
|
|
58
58
|
}
|
|
59
59
|
export interface IExtrudableGeometry extends IGeometry {
|
|
60
60
|
}
|
|
61
|
+
export interface IArcPoints extends IExtrudableGeometry {
|
|
62
|
+
/**
|
|
63
|
+
* Sets the bulge radius for point-to-point arcs.
|
|
64
|
+
* Positive = CCW, negative = CW.
|
|
65
|
+
* @param value - The bulge radius.
|
|
66
|
+
*/
|
|
67
|
+
radius(value: number): this;
|
|
68
|
+
/**
|
|
69
|
+
* Specifies the circle center point for the arc.
|
|
70
|
+
* Mutually exclusive with `.radius()`.
|
|
71
|
+
* @param value - The center point of the arc's circle.
|
|
72
|
+
*/
|
|
73
|
+
center(value: Point2DLike): this;
|
|
74
|
+
}
|
|
75
|
+
export interface IArcAngles extends IExtrudableGeometry {
|
|
76
|
+
/**
|
|
77
|
+
* Centers the arc symmetrically around the start angle.
|
|
78
|
+
*/
|
|
79
|
+
centered(): this;
|
|
80
|
+
}
|
|
61
81
|
export interface IRect extends IExtrudableGeometry {
|
|
62
82
|
/**
|
|
63
83
|
* Sets corner radii for a rounded rectangle. Accepts 1–4 values
|
|
@@ -71,7 +91,7 @@ export interface IRect extends IExtrudableGeometry {
|
|
|
71
91
|
* @param value - `true` centers on both axes, `'horizontal'` or `'vertical'` centers
|
|
72
92
|
* on one axis, `false` (default) keeps the current point as the origin corner.
|
|
73
93
|
*/
|
|
74
|
-
|
|
94
|
+
centered(value?: boolean | 'horizontal' | 'vertical'): this;
|
|
75
95
|
/**
|
|
76
96
|
* Returns the top straight edge of the rectangle.
|
|
77
97
|
*/
|
|
@@ -127,7 +147,7 @@ export interface ISlot extends IExtrudableGeometry {
|
|
|
127
147
|
* When `true`, the slot is offset backward by half its length.
|
|
128
148
|
* @param value - `true` to center, `false` (default) to start from the current position.
|
|
129
149
|
*/
|
|
130
|
-
|
|
150
|
+
centered(value?: boolean): this;
|
|
131
151
|
/**
|
|
132
152
|
* Sets the rotation angle of the slot's primary axis.
|
|
133
153
|
* @param angle - Rotation in degrees.
|
|
@@ -244,6 +264,20 @@ export interface IExtrude extends IFuseable {
|
|
|
244
264
|
* @param points - 2D points in the sketch plane identifying regions to extrude.
|
|
245
265
|
*/
|
|
246
266
|
pick(...points: Point2DLike[]): this;
|
|
267
|
+
/**
|
|
268
|
+
* Enables thin extrude mode — offsets the profile edges to create a thin-walled solid
|
|
269
|
+
* instead of extruding filled faces. Positive values offset outward, negative values offset inward.
|
|
270
|
+
* @param offset - The wall offset distance. Positive = outward, negative = inward.
|
|
271
|
+
*/
|
|
272
|
+
thin(offset: number): this;
|
|
273
|
+
/**
|
|
274
|
+
* Enables thin extrude mode with two offset directions.
|
|
275
|
+
* The two offsets must go in opposite directions. If both have the same sign,
|
|
276
|
+
* the second offset is automatically flipped.
|
|
277
|
+
* @param offset1 - The first wall offset distance. Positive = outward, negative = inward.
|
|
278
|
+
* @param offset2 - The second wall offset distance, in the opposite direction of offset1.
|
|
279
|
+
*/
|
|
280
|
+
thin(offset1: number, offset2: number): this;
|
|
247
281
|
}
|
|
248
282
|
export interface ICut extends ISceneObject {
|
|
249
283
|
/**
|
|
@@ -290,6 +324,20 @@ export interface ICut extends ISceneObject {
|
|
|
290
324
|
* @param points - 2D points in the sketch plane identifying regions to cut.
|
|
291
325
|
*/
|
|
292
326
|
pick(...points: Point2DLike[]): this;
|
|
327
|
+
/**
|
|
328
|
+
* Enables thin cut mode — offsets the profile edges to cut a thin-walled shape
|
|
329
|
+
* instead of cutting filled faces. Positive values offset outward, negative values offset inward.
|
|
330
|
+
* @param offset - The wall offset distance. Positive = outward, negative = inward.
|
|
331
|
+
*/
|
|
332
|
+
thin(offset: number): this;
|
|
333
|
+
/**
|
|
334
|
+
* Enables thin cut mode with two offset directions.
|
|
335
|
+
* The two offsets must go in opposite directions. If both have the same sign,
|
|
336
|
+
* the second offset is automatically flipped.
|
|
337
|
+
* @param offset1 - The first wall offset distance. Positive = outward, negative = inward.
|
|
338
|
+
* @param offset2 - The second wall offset distance, in the opposite direction of offset1.
|
|
339
|
+
*/
|
|
340
|
+
thin(offset1: number, offset2: number): this;
|
|
293
341
|
}
|
|
294
342
|
export interface IRevolve extends IFuseable {
|
|
295
343
|
/**
|
package/lib/dist/core/repeat.js
CHANGED
|
@@ -73,9 +73,16 @@ function build(context) {
|
|
|
73
73
|
indexCombinations.push(...newCombinations);
|
|
74
74
|
}
|
|
75
75
|
for (const indices of indexCombinations) {
|
|
76
|
-
// Skip the origin instance
|
|
77
|
-
if (
|
|
78
|
-
|
|
76
|
+
// Skip the origin instance
|
|
77
|
+
if (options.centered) {
|
|
78
|
+
if (indices.every((idx, a) => idx === Math.floor(axisOffsets[a].count / 2))) {
|
|
79
|
+
continue;
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
else {
|
|
83
|
+
if (indices.every(i => i === 0)) {
|
|
84
|
+
continue;
|
|
85
|
+
}
|
|
79
86
|
}
|
|
80
87
|
// Skip if in the skip list
|
|
81
88
|
if (options.skip?.some(s => s.length === indices.length && s.every((v, i) => v === indices[i]))) {
|
|
@@ -1,19 +1,32 @@
|
|
|
1
|
+
import { Point2DLike } from "../../math/point.js";
|
|
1
2
|
import { PlaneObjectBase } from "../plane-renderable-base.js";
|
|
2
3
|
import { GeometrySceneObject } from "./geometry.js";
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
private
|
|
9
|
-
|
|
4
|
+
import { LazyVertex } from "../lazy-vertex.js";
|
|
5
|
+
import { IArcPoints, IArcAngles } from "../../core/interfaces.js";
|
|
6
|
+
export declare class Arc extends GeometrySceneObject implements IArcPoints, IArcAngles {
|
|
7
|
+
private _startPoint;
|
|
8
|
+
private _endPoint;
|
|
9
|
+
private _arcRadius;
|
|
10
|
+
private _startAngle;
|
|
11
|
+
private _endAngle;
|
|
12
|
+
private _bulgeRadius;
|
|
13
|
+
private _centerPoint;
|
|
14
|
+
private _centered;
|
|
15
|
+
private _targetPlane;
|
|
16
|
+
constructor(targetPlane?: PlaneObjectBase | null);
|
|
17
|
+
static toPoint(endPoint: LazyVertex, targetPlane?: PlaneObjectBase | null): Arc;
|
|
18
|
+
static twoPoints(startPoint: LazyVertex, endPoint: LazyVertex, targetPlane?: PlaneObjectBase | null): Arc;
|
|
19
|
+
static fromAngles(arcRadius: number, startAngle: number, endAngle: number, targetPlane?: PlaneObjectBase | null): Arc;
|
|
20
|
+
radius(value: number): this;
|
|
21
|
+
center(value: Point2DLike): this;
|
|
22
|
+
centered(): this;
|
|
10
23
|
build(): void;
|
|
24
|
+
private buildTwoPointsCenter;
|
|
25
|
+
private buildTwoPointsBulge;
|
|
26
|
+
private buildToPoint;
|
|
27
|
+
private buildWithCenter;
|
|
28
|
+
private buildFromAngles;
|
|
11
29
|
getType(): string;
|
|
12
|
-
compareTo(other:
|
|
13
|
-
serialize():
|
|
14
|
-
radius: number;
|
|
15
|
-
startAngle: number;
|
|
16
|
-
endAngle: number;
|
|
17
|
-
centered: boolean;
|
|
18
|
-
};
|
|
30
|
+
compareTo(other: Arc): boolean;
|
|
31
|
+
serialize(): Record<string, unknown>;
|
|
19
32
|
}
|