@snaptrude/plugin-core 0.9.3 → 0.9.5

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/dist/index.js CHANGED
@@ -134,7 +134,11 @@ var PluginGeomCreateBrepFromExtrusionArgs = z2.object({
134
134
  var PluginGeomCreateBrepFromLoftArgs = z2.object({
135
135
  bottomContour: ContourHandle,
136
136
  topContour: ContourHandle,
137
- intermediateContours: z2.array(ContourHandle).optional()
137
+ intermediateContours: z2.array(ContourHandle).optional(),
138
+ options: z2.object({
139
+ compatibility: z2.enum(["strict", "auto"]).optional(),
140
+ seamAlignment: z2.enum(["authored", "auto"]).optional()
141
+ }).optional()
138
142
  });
139
143
  var PluginGeomCreateBrepFromMeshArgs = z2.object({
140
144
  positions: z2.array(Vec3Components).min(4),
@@ -173,9 +177,34 @@ var PluginGeomCreateBrepFromChamferArgs = z2.object({
173
177
  edges: z2.array(EdgeHandle).min(1),
174
178
  distance: z2.number().finite().positive()
175
179
  });
180
+ var SweepScaleFactor = z2.number().finite().min(1e-3).max(1e3);
176
181
  var PluginGeomCreateBrepFromSweepArgs = z2.object({
177
182
  profile: ContourHandle,
178
- path: z2.array(FiniteVec3Components).min(2)
183
+ path: z2.array(FiniteVec3Components).min(2),
184
+ options: z2.object({
185
+ startScale: SweepScaleFactor.optional(),
186
+ endScale: SweepScaleFactor.optional(),
187
+ scales: z2.array(SweepScaleFactor).optional(),
188
+ transition: z2.union([
189
+ z2.literal("miter"),
190
+ z2.object({ bevel: z2.number().finite().min(1e-3).max(1e3) })
191
+ ]).optional()
192
+ }).optional()
193
+ }).superRefine((a, ctx) => {
194
+ const options = a.options;
195
+ if (!options || options.scales === void 0) return;
196
+ if (options.startScale !== void 0 || options.endScale !== void 0) {
197
+ ctx.addIssue({
198
+ code: z2.ZodIssueCode.custom,
199
+ message: "scales is mutually exclusive with startScale/endScale"
200
+ });
201
+ }
202
+ if (options.scales.length !== a.path.length) {
203
+ ctx.addIssue({
204
+ code: z2.ZodIssueCode.custom,
205
+ message: "scales must have exactly one entry per path point"
206
+ });
207
+ }
179
208
  });
180
209
  var PluginGeomCreateBrepFromRevolutionArgs = z2.object({
181
210
  profile: ContourHandle,
@@ -495,6 +524,10 @@ var PluginGeomQueryBrepListHalfEdgesArgs = brepArg;
495
524
  var PluginGeomQueryBrepGetEdgeArgs = brepEdgeArg;
496
525
  var PluginGeomQueryBrepHasEdgeArgs = brepEdgeArg;
497
526
  var PluginGeomQueryBrepListEdgesBetweenArgs = brepEdgeArg;
527
+ var PluginGeomQueryBrepGetEdgeCurveArgs = z8.object({
528
+ brep: BrepHandle,
529
+ edge: EdgeHandle
530
+ });
498
531
  var PluginGeomQueryBrepGetVertexPositionArgs = z8.object({
499
532
  brep: BrepHandle,
500
533
  vertex: VertexHandle
@@ -1397,6 +1430,135 @@ var PluginUnderlaySetOpacityArgs = z32.object({
1397
1430
  var PluginUnderlayRefArgs = z32.object({
1398
1431
  underlay: UnderlayHandle
1399
1432
  });
1433
+ var PluginCadLineGeometry = z32.object({
1434
+ type: z32.literal("line"),
1435
+ start: Vec3Components,
1436
+ end: Vec3Components
1437
+ });
1438
+ var PluginCadArcGeometry = z32.object({
1439
+ type: z32.literal("arc"),
1440
+ centre: Vec3Components,
1441
+ axis: Vec3Components,
1442
+ start: Vec3Components,
1443
+ end: Vec3Components
1444
+ });
1445
+ var PluginCadGeometry = z32.discriminatedUnion("type", [
1446
+ PluginCadLineGeometry,
1447
+ PluginCadArcGeometry
1448
+ ]);
1449
+ var PluginCadLayerGeometryOptions = z32.object({
1450
+ offset: z32.number().int().nonnegative().default(0),
1451
+ limit: z32.number().int().positive().max(1e3).default(500)
1452
+ });
1453
+ var PluginCadLayerGeometryArgs = z32.object({
1454
+ underlay: UnderlayHandle,
1455
+ layer: z32.string(),
1456
+ options: PluginCadLayerGeometryOptions.default({ offset: 0, limit: 500 })
1457
+ });
1458
+ var PluginCadLayerGeometryPage = z32.object({
1459
+ layer: z32.string(),
1460
+ coordinateSpace: z32.literal("snaptrude-world"),
1461
+ units: z32.literal("snaptrude-internal"),
1462
+ total: z32.number().int().nonnegative(),
1463
+ offset: z32.number().int().nonnegative(),
1464
+ curves: z32.array(PluginCadGeometry)
1465
+ });
1466
+ var PluginPlanPoint = z32.object({ x: z32.number(), z: z32.number() });
1467
+ var PluginCadCenterlineOptions = z32.object({
1468
+ thicknessRange: z32.tuple([z32.number().positive(), z32.number().positive()]).default([0.3, 1.6]),
1469
+ mergeGap: z32.number().nonnegative().default(0.05),
1470
+ minLength: z32.number().nonnegative().default(0.1),
1471
+ parallelTolDeg: z32.number().positive().max(15).default(2),
1472
+ minOverlap: z32.number().min(0).max(1).default(0.6),
1473
+ bridgeOpenings: z32.object({ maxWidth: z32.number().positive() }).nullable().default({ maxWidth: 9.6 })
1474
+ });
1475
+ var PluginCadCenterlinesArgs = z32.object({
1476
+ underlay: UnderlayHandle,
1477
+ layer: z32.string(),
1478
+ options: PluginCadCenterlineOptions.default({
1479
+ thicknessRange: [0.3, 1.6],
1480
+ mergeGap: 0.05,
1481
+ minLength: 0.1,
1482
+ parallelTolDeg: 2,
1483
+ minOverlap: 0.6,
1484
+ bridgeOpenings: { maxWidth: 9.6 }
1485
+ })
1486
+ });
1487
+ var PluginCadOpening = z32.object({
1488
+ start: PluginPlanPoint,
1489
+ end: PluginPlanPoint,
1490
+ width: z32.number()
1491
+ });
1492
+ var PluginCadCenterline = z32.object({
1493
+ start: PluginPlanPoint,
1494
+ end: PluginPlanPoint,
1495
+ thickness: z32.number(),
1496
+ length: z32.number(),
1497
+ sourceFaceCount: z32.number().int().nonnegative(),
1498
+ openings: z32.array(PluginCadOpening)
1499
+ });
1500
+ var PluginCadUnpairedFace = z32.object({
1501
+ start: PluginPlanPoint,
1502
+ end: PluginPlanPoint,
1503
+ length: z32.number()
1504
+ });
1505
+ var PluginCadCenterlinesResult = z32.object({
1506
+ layer: z32.string(),
1507
+ coordinateSpace: z32.literal("snaptrude-world"),
1508
+ units: z32.literal("snaptrude-internal"),
1509
+ centerlines: z32.array(PluginCadCenterline),
1510
+ unpaired: z32.array(PluginCadUnpairedFace),
1511
+ stats: z32.object({
1512
+ curvesRead: z32.number().int().nonnegative(),
1513
+ arcsSkipped: z32.number().int().nonnegative(),
1514
+ fragmentsCulled: z32.number().int().nonnegative(),
1515
+ duplicates: z32.number().int().nonnegative(),
1516
+ faces: z32.number().int().nonnegative()
1517
+ })
1518
+ });
1519
+ var PluginCadArcClassifyOptions = z32.object({
1520
+ radiusRange: z32.tuple([z32.number().positive(), z32.number().positive()]).default([3, 5.4]),
1521
+ sweepRangeDeg: z32.tuple([z32.number().positive(), z32.number().positive()]).default([60, 120]),
1522
+ clusterTol: z32.number().positive().default(0.1)
1523
+ });
1524
+ var PluginCadArcClassifyArgs = z32.object({
1525
+ underlay: UnderlayHandle,
1526
+ layer: z32.string(),
1527
+ options: PluginCadArcClassifyOptions.default({
1528
+ radiusRange: [3, 5.4],
1529
+ sweepRangeDeg: [60, 120],
1530
+ clusterTol: 0.1
1531
+ })
1532
+ });
1533
+ var PluginCadDoorCandidate = z32.object({
1534
+ hinge: PluginPlanPoint,
1535
+ leafWidth: z32.number(),
1536
+ swingDir: PluginPlanPoint,
1537
+ wallDir: PluginPlanPoint,
1538
+ openingWidth: z32.number(),
1539
+ double: z32.boolean()
1540
+ });
1541
+ var PluginCadArcClassifyResult = z32.object({
1542
+ layer: z32.string(),
1543
+ coordinateSpace: z32.literal("snaptrude-world"),
1544
+ units: z32.literal("snaptrude-internal"),
1545
+ doors: z32.array(PluginCadDoorCandidate),
1546
+ rejected: z32.array(
1547
+ z32.object({
1548
+ centre: PluginPlanPoint,
1549
+ radius: z32.number(),
1550
+ sweepDeg: z32.number(),
1551
+ reason: z32.string()
1552
+ })
1553
+ ),
1554
+ radiusHistogram: z32.array(
1555
+ z32.object({ radius: z32.number(), count: z32.number().int().positive() })
1556
+ ),
1557
+ stats: z32.object({
1558
+ curvesRead: z32.number().int().nonnegative(),
1559
+ arcsConsidered: z32.number().int().nonnegative()
1560
+ })
1561
+ });
1400
1562
 
1401
1563
  // src/api/core/io/terrain/index.ts
1402
1564
  import * as z33 from "zod";
@@ -2189,6 +2351,29 @@ var PluginDesignQueryApi = class {
2189
2351
  constructor() {
2190
2352
  }
2191
2353
  };
2354
+ var PluginOutlinePlanPoint = z42.object({ x: z42.number(), z: z42.number() });
2355
+ var PluginStoreyOutlineOptions = z42.object({
2356
+ storey: z42.number().int().optional(),
2357
+ include: z42.array(PluginEntityType).nonempty().default(["wall"]),
2358
+ minArea: z42.number().nonnegative().default(1)
2359
+ });
2360
+ var PluginStoreyFootprint = z42.object({
2361
+ outline: z42.array(PluginOutlinePlanPoint),
2362
+ holes: z42.array(
2363
+ z42.object({
2364
+ ring: z42.array(PluginOutlinePlanPoint),
2365
+ areaSq: z42.number().nonnegative()
2366
+ })
2367
+ ),
2368
+ areaSq: z42.number().nonnegative(),
2369
+ enclosed: z42.boolean()
2370
+ });
2371
+ var PluginStoreyOutlineResult = z42.object({
2372
+ footprints: z42.array(PluginStoreyFootprint),
2373
+ discarded: z42.array(
2374
+ z42.object({ areaSq: z42.number().nonnegative(), reason: z42.string() })
2375
+ )
2376
+ });
2192
2377
 
2193
2378
  // src/api/design/selection/index.ts
2194
2379
  import * as z43 from "zod";
@@ -5462,6 +5647,22 @@ export {
5462
5647
  PluginBuildingType,
5463
5648
  PluginBuildingTypeKind,
5464
5649
  PluginBuildingTypeSummary,
5650
+ PluginCadArcClassifyArgs,
5651
+ PluginCadArcClassifyOptions,
5652
+ PluginCadArcClassifyResult,
5653
+ PluginCadArcGeometry,
5654
+ PluginCadCenterline,
5655
+ PluginCadCenterlineOptions,
5656
+ PluginCadCenterlinesArgs,
5657
+ PluginCadCenterlinesResult,
5658
+ PluginCadDoorCandidate,
5659
+ PluginCadGeometry,
5660
+ PluginCadLayerGeometryArgs,
5661
+ PluginCadLayerGeometryOptions,
5662
+ PluginCadLayerGeometryPage,
5663
+ PluginCadLineGeometry,
5664
+ PluginCadOpening,
5665
+ PluginCadUnpairedFace,
5465
5666
  PluginCameraApi,
5466
5667
  PluginCameraLookFromArgs,
5467
5668
  PluginCameraMode,
@@ -5775,6 +5976,7 @@ export {
5775
5976
  PluginGeomQueryBrepGetDistanceArgs,
5776
5977
  PluginGeomQueryBrepGetEdgeArgs,
5777
5978
  PluginGeomQueryBrepGetEdgeCountArgs,
5979
+ PluginGeomQueryBrepGetEdgeCurveArgs,
5778
5980
  PluginGeomQueryBrepGetFaceCountArgs,
5779
5981
  PluginGeomQueryBrepGetHalfEdgeCountArgs,
5780
5982
  PluginGeomQueryBrepGetVertexCountArgs,
@@ -5955,6 +6157,7 @@ export {
5955
6157
  PluginNotFoundError,
5956
6158
  PluginObjectCatalogGroup,
5957
6159
  PluginObjectCatalogItem,
6160
+ PluginOutlinePlanPoint,
5958
6161
  PluginPermissionError,
5959
6162
  PluginPlacedView,
5960
6163
  PluginPlacedViewCrop,
@@ -5969,6 +6172,7 @@ export {
5969
6172
  PluginPlacedViewsSetOpacityArgs,
5970
6173
  PluginPlacedViewsUpdateFontStylesArgs,
5971
6174
  PluginPlacedViewsUpdateStylesArgs,
6175
+ PluginPlanPoint,
5972
6176
  PluginPresentationAIInspirationApi,
5973
6177
  PluginPresentationAnnotateApi,
5974
6178
  PluginPresentationAnnotateArrowArgs,
@@ -6292,6 +6496,9 @@ export {
6292
6496
  PluginStaircaseParams,
6293
6497
  PluginStaircasePreset,
6294
6498
  PluginStandardView,
6499
+ PluginStoreyFootprint,
6500
+ PluginStoreyOutlineOptions,
6501
+ PluginStoreyOutlineResult,
6295
6502
  PluginStoryApi,
6296
6503
  PluginStoryCreateArgs,
6297
6504
  PluginStoryCreateResult,