@toolpath/viewer 2.3.3 → 2.6.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 +139 -4
- package/dist/{chunk-M2B3CQPQ.js → chunk-ESPHWO5M.js} +367 -84
- package/dist/engine/index.d.ts +14 -3
- package/dist/engine/index.js +5 -3
- package/dist/index.d.ts +81 -4
- package/dist/index.js +1141 -368
- package/dist/{normalize-C4Wj4IGK.d.ts → normalize-BBADLCmd.d.ts} +47 -2
- package/package.json +1 -1
|
@@ -546,6 +546,39 @@ declare function findSharpCorners(creases: SurfaceCreases, model: Pick<PartModel
|
|
|
546
546
|
/** The flagged features' corners, as `x y z x y z` endpoint pairs. See {@link findSharpCorners}. */
|
|
547
547
|
declare function sharpCornerPositions(creases: SurfaceCreases, model: Pick<PartModel, 'features' | 'regionIndex'>, options: SharpCornerOptions): Float32Array;
|
|
548
548
|
|
|
549
|
+
/**
|
|
550
|
+
* Threads drawn into the bores they are cut in.
|
|
551
|
+
*
|
|
552
|
+
* The kernel cuts a modeled internal thread out of the body before it meshes
|
|
553
|
+
* it, so a tapped hole arrives as a plain bore. A displacement map cannot put
|
|
554
|
+
* the thread back: it moves vertices, and wants UVs and a dense mesh, where
|
|
555
|
+
* the Engine's has neither — a small bore is a handful of 30° facets. So the
|
|
556
|
+
* thread is drawn the way a bump map draws: the part's shader tilts each
|
|
557
|
+
* pixel's normal along the bore's axis as a helix of the thread's pitch runs
|
|
558
|
+
* past it, and the light falls as it would on the flanks of a real thread.
|
|
559
|
+
* The silhouette stays round, which inside a bore nobody sees.
|
|
560
|
+
*
|
|
561
|
+
* What the shader needs per region is the bore's axis, a point on it, and the
|
|
562
|
+
* pitch. The pitch comes from the caller; the axis and the point are fitted
|
|
563
|
+
* here from the region's own triangles, so the drawing sits on the mesh
|
|
564
|
+
* exactly and needs nothing from the report it does not already carry.
|
|
565
|
+
*/
|
|
566
|
+
/** One thread to draw, on the faces of the hole it is cut in. */
|
|
567
|
+
interface ThreadMark {
|
|
568
|
+
/** The regions of the threaded hole, as the report numbers them. */
|
|
569
|
+
readonly regions: readonly number[];
|
|
570
|
+
/** From one crest to the next, in mm. Negative for a left-hand thread. */
|
|
571
|
+
readonly pitch: number;
|
|
572
|
+
/**
|
|
573
|
+
* The thread's major diameter, in mm. A cylinder of the hole wider than
|
|
574
|
+
* this — a counterbore — is not threaded, and is left plain.
|
|
575
|
+
*/
|
|
576
|
+
readonly majorDiameter: number;
|
|
577
|
+
}
|
|
578
|
+
interface ThreadOptions {
|
|
579
|
+
readonly threads: readonly ThreadMark[];
|
|
580
|
+
}
|
|
581
|
+
|
|
549
582
|
/** The vertex attribute carrying each vertex's column in the state texture. */
|
|
550
583
|
declare const REGION_ATTRIBUTE = "aRegion";
|
|
551
584
|
type PartDisplay = 'solid' | 'wireframe';
|
|
@@ -610,6 +643,11 @@ interface PartObject {
|
|
|
610
643
|
}, camera: ViewerCamera, viewport: ViewportSize): SharpCorner | null;
|
|
611
644
|
/** Draws one corner up as the one under the pointer; `null` for none. */
|
|
612
645
|
setHoveredSharpCorner(index: number | null): void;
|
|
646
|
+
/**
|
|
647
|
+
* Draws threads into the bores they are cut in — see `render/threads.ts`.
|
|
648
|
+
* `null` draws none. Keyed by content, like `setSharpCorners`.
|
|
649
|
+
*/
|
|
650
|
+
setThreads(options: ThreadOptions | null): void;
|
|
613
651
|
dispose(): void;
|
|
614
652
|
}
|
|
615
653
|
interface RegionPaint {
|
|
@@ -1180,6 +1218,13 @@ interface PartMeshProps {
|
|
|
1180
1218
|
* Coloured by the theme's `sharpCorner`.
|
|
1181
1219
|
*/
|
|
1182
1220
|
sharpCorners?: SharpCornerOptions | null;
|
|
1221
|
+
/**
|
|
1222
|
+
* Draws threads into the bores they are cut in: each mark's pitch, as a
|
|
1223
|
+
* helix of light and shade over the hole's cylinders. The Engine cuts a
|
|
1224
|
+
* modeled internal thread out of the mesh, so without this a tapped hole is
|
|
1225
|
+
* a plain bore. Off when omitted or `null`. See `threadMark` in `/engine`.
|
|
1226
|
+
*/
|
|
1227
|
+
threads?: ThreadOptions | null;
|
|
1183
1228
|
/** Wireframe shows region boundaries and any hovered/painted faces, with no triangle diagonals. */
|
|
1184
1229
|
display?: PartDisplay;
|
|
1185
1230
|
/**
|
|
@@ -1198,7 +1243,7 @@ interface PartMeshProps {
|
|
|
1198
1243
|
* React render at all: the hovered face lives in a ref, and routing it through
|
|
1199
1244
|
* state is what this rewrite exists to stop doing.
|
|
1200
1245
|
*/
|
|
1201
|
-
declare const PartMesh: ({ model, geometry, selection, focus, candidates, highlights, regionHighlights, pickedRegions, hoveredFeatureIds, hover, activeDirection, section, onSectionChange, onAdjacency, focusFeature, onHover, onPick, theme, showEdges, sharpCorners, display, children, }: PartMeshProps) => react.JSX.Element;
|
|
1246
|
+
declare const PartMesh: ({ model, geometry, selection, focus, candidates, highlights, regionHighlights, pickedRegions, hoveredFeatureIds, hover, activeDirection, section, onSectionChange, onAdjacency, focusFeature, onHover, onPick, theme, showEdges, sharpCorners, threads, display, children, }: PartMeshProps) => react.JSX.Element;
|
|
1202
1247
|
|
|
1203
1248
|
interface EnginePartProps extends Omit<PartMeshProps, 'model' | 'geometry'> {
|
|
1204
1249
|
/**
|
|
@@ -1273,4 +1318,4 @@ declare function normalizePartReport(report: unknown): PartModel;
|
|
|
1273
1318
|
*/
|
|
1274
1319
|
declare function assertSupportedKernelVersion(kernelVersion: string): void;
|
|
1275
1320
|
|
|
1276
|
-
export {
|
|
1321
|
+
export { PICKED_SURFACE_LABEL as $, AXES_PLANE_OFFSET as A, type BuildPickInput as B, type CameraLimits as C, DEFAULT_FIT_MARGIN as D, EnginePart as E, type FeatureTag as F, EXCLUDE_FROM_FRAME as G, type FeatureHighlight as H, type FocusOptions as I, HANDLE_PIXELS as J, HIGHLIGHT_COLORS as K, HIGHLIGHT_WEIGHT as L, MIN_KERNEL_VERSION as M, HOVER_WEIGHT as N, type HighlightLayers as O, type PartModel as P, type KnownFeatureType as Q, type RegionHighlight as R, type SectionOptions as S, type ThreadMark as T, type KnownShapeKind as U, type Vec3 as V, MAX_FRAME_RATIO as W, MIN_FRAME_RATIO as X, NO_MODIFIERS as Y, OUTLINE_SCALE as Z, PERSPECTIVE_FOV as _, type PartMeshRefs as a, targetBoundary as a$, PREVIEW_SCALE as a0, type PartDisplay as a1, PartMesh as a2, type PartMeshProps as a3, type PartObject as a4, type PickModifiers as a5, type PointerLocation as a6, REGION_ATTRIBUTE as a7, type RegionPaint as a8, SECTION_GIZMO_FRAME_SCALE as a9, directionColor as aA, dragPlane as aB, excludedFromFrame as aC, findSharpCorners as aD, fitDistance as aE, focusForPick as aF, hitUnderRay as aG, orthographicHalfHeight as aH, perspectiveFitDistance as aI, pickedStartDepth as aJ, resolveTheme as aK, screenLength as aL, sectionAnchor as aM, sectionBounds as aN, sectionConstant as aO, sectionDepth as aP, sectionDepthConstant as aQ, sectionDepthRange as aR, sectionFromPick as aS, sectionMeasurement as aT, sectionOffset as aU, sectionOptionsFromState as aV, sectionPlane as aW, sharpCornerPositions as aX, startPosition as aY, surfaceCreases as aZ, surfaceUnderRay as a_, SECTION_RENDER_ORDER as aa, type SceneBounds as ab, type SectionAnchor as ac, type SectionBounds as ad, type SectionPlacement as ae, type ShapeKind as af, type SharpCorner as ag, type SharpCornerOptions as ah, type SurfaceCreases as ai, type SurfaceHit as aj, type ThreadOptions as ak, adaptedUp as al, applyHighlightLayers as am, applyProjection as an, aspectRatio as ao, axesPlanes as ap, boundsFromBox as aq, buildPick as ar, buildRegionAttribute as as, buildRegionTexels as at, cadViewDirections as au, cameraLimits as av, contentBounds as aw, createPart as ax, currentViewDirection as ay, defaultBounds as az, type PartModelFeature as b, themesEqual as b0, viewDirection as b1, type EnginePartProps as c, assertSupportedKernelVersion as d, type PartPick as e, type ViewerTheme as f, type SectionState as g, type ViewerCamera as h, type ViewportSize as i, type PartModelRegion as j, type ViewerView as k, type Projection as l, type TriangleRange as m, normalizePartReport as n, type RegionIndex as o, type FeatureType as p, AXES_PLANE_SCALE as q, type AxesPlane as r, smoothRegionNormals as s, CAD_CAMERA_UP as t, CANDIDATE_WEIGHT as u, CAP_HATCH as v, DEFAULT_SECTION_NORMAL as w, DEFAULT_THEME as x, DIRECTION_COLORS as y, DISABLED_SECTION as z };
|