jscad-electronics 0.0.189 → 0.0.190

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/vanilla.d.ts CHANGED
@@ -2,8 +2,8 @@ import { MaterialOptions } from 'jscad-fiber';
2
2
  import { BufferGeometry } from 'three';
3
3
  import * as jscadModeling from '@jscad/modeling';
4
4
  import * as react_jsx_runtime from 'react/jsx-runtime';
5
- import { NemaMotorModelPropsInput, HexSocketBoltModelPropsInput, SheetMetalModelPropsInput, SpurGearModelPropsInput, HelicalGearModelPropsInput, WormGearModelPropsInput, HexBoltModelPropsInput } from '@tscircuit/modelprinter';
6
5
  import * as _jscad_modeling_src_geometries_types from '@jscad/modeling/src/geometries/types';
6
+ import { SpurGearModelPropsInput, HelicalGearModelPropsInput, HexBoltModelPropsInput, HexSocketBoltModelPropsInput, NemaMotorModelPropsInput, SheetMetalModelPropsInput, WormGearModelPropsInput } from '@tscircuit/modelprinter';
7
7
 
8
8
  type VNode = {
9
9
  type: any;
@@ -26,20 +26,51 @@ type RenderResult = {
26
26
 
27
27
  declare function convertCSGToThreeGeom(csg: any): BufferGeometry;
28
28
 
29
- type NemaMotorProps = NemaMotorModelPropsInput & {
30
- bodyColor?: string;
31
- capColor?: string;
32
- shaftColor?: string;
33
- screwColor?: string;
34
- };
35
- type NemaFrameMotorProps = Omit<NemaMotorProps, "nemaSize">;
36
- /** Mounting face at Z=0, body along -Z, shaft along +Z; all lengths in mm.
37
- * Parameters follow the modelprinter NEMA contract; JSCAD builds all geometry.
29
+ /** Indexed triangles, counterclockwise from outside; millimeters, Z up. */
30
+ interface SpurGearMesh {
31
+ positions: number[];
32
+ indices: number[];
33
+ }
34
+ /**
35
+ * An external involute spur gear with its lower face at Z=0. Tooth centers
36
+ * start on +X and rotate counterclockwise with phase. The optional hub extends
37
+ * above the upper face, and the round bore passes through both gear and hub.
38
+ * Flanks are sampled involutes; tips and root valleys follow circular arcs.
39
+ * Below the base circle the flanks extend radially, without a generated
40
+ * trochoidal root fillet or cutter undercut. No CSG or renderer is required.
38
41
  */
39
- declare function NemaMotor({ bodyColor, capColor, shaftColor, screwColor, ...props }: NemaMotorProps): react_jsx_runtime.JSX.Element;
40
- declare const NEMA8: (props: NemaFrameMotorProps) => react_jsx_runtime.JSX.Element;
41
- declare const NEMA17: (props: NemaFrameMotorProps) => react_jsx_runtime.JSX.Element;
42
- declare const NEMA23: (props: NemaFrameMotorProps) => react_jsx_runtime.JSX.Element;
42
+ declare function createSpurGearMesh(input: SpurGearModelPropsInput): SpurGearMesh;
43
+
44
+ type HelicalGearMesh = SpurGearMesh;
45
+ /**
46
+ * Twisted transverse involute teeth from Z=0 to faceWidth, with a stationary
47
+ * round bore and optional hub. Zero helix angle reproduces the spur mesh.
48
+ */
49
+ declare function createHelicalGearMesh(input: HelicalGearModelPropsInput): HelicalGearMesh;
50
+
51
+ type HelicalGearProps = HelicalGearModelPropsInput & {
52
+ color?: string;
53
+ };
54
+ /** Axis +Z, lower face Z=0; optional hub extends above the gear face. */
55
+ declare function createHelicalGearGeom(input: HelicalGearModelPropsInput): _jscad_modeling_src_geometries_types.Geom3;
56
+ declare function HelicalGear({ color, ...props }: HelicalGearProps): react_jsx_runtime.JSX.Element;
57
+
58
+ interface HexBoltMeshOptions {
59
+ radialSegments?: number;
60
+ threadStepsPerTurn?: number;
61
+ }
62
+ /** Outward-oriented, welded indexed surface, in millimeters. */
63
+ interface HexBoltMesh {
64
+ positions: number[];
65
+ indices: number[];
66
+ }
67
+ declare function createHexBoltMesh(input: HexBoltModelPropsInput, options?: HexBoltMeshOptions): HexBoltMesh;
68
+
69
+ type HexBoltProps = HexBoltModelPropsInput & {
70
+ color?: string;
71
+ };
72
+ declare function createHexBoltGeom(input: HexBoltModelPropsInput, options?: HexBoltMeshOptions): _jscad_modeling_src_geometries_types.Geom3;
73
+ declare function HexBolt({ color, ...props }: HexBoltProps): react_jsx_runtime.JSX.Element;
43
74
 
44
75
  /** Indexed triangles, counterclockwise from outside; millimeters, Z up. */
45
76
  interface HexSocketBoltMesh {
@@ -61,6 +92,21 @@ type HexSocketBoltProps = HexSocketBoltModelPropsInput & {
61
92
  declare function createHexSocketBoltGeom(input: HexSocketBoltModelPropsInput): _jscad_modeling_src_geometries_types.Geom3;
62
93
  declare function HexSocketBolt({ color, ...props }: HexSocketBoltProps): react_jsx_runtime.JSX.Element;
63
94
 
95
+ type NemaMotorProps = NemaMotorModelPropsInput & {
96
+ bodyColor?: string;
97
+ capColor?: string;
98
+ shaftColor?: string;
99
+ screwColor?: string;
100
+ };
101
+ type NemaFrameMotorProps = Omit<NemaMotorProps, "nemaSize">;
102
+ /** Mounting face at Z=0, body along -Z, shaft along +Z; all lengths in mm.
103
+ * Parameters follow the modelprinter NEMA contract; JSCAD builds all geometry.
104
+ */
105
+ declare function NemaMotor({ bodyColor, capColor, shaftColor, screwColor, ...props }: NemaMotorProps): react_jsx_runtime.JSX.Element;
106
+ declare const NEMA8: (props: NemaFrameMotorProps) => react_jsx_runtime.JSX.Element;
107
+ declare const NEMA17: (props: NemaFrameMotorProps) => react_jsx_runtime.JSX.Element;
108
+ declare const NEMA23: (props: NemaFrameMotorProps) => react_jsx_runtime.JSX.Element;
109
+
64
110
  interface SheetMetalMesh {
65
111
  positions: number[];
66
112
  indices: number[];
@@ -80,35 +126,6 @@ type SheetMetalProps = SheetMetalModelPropsInput & {
80
126
  declare function createSheetMetalGeom(input: SheetMetalModelPropsInput): _jscad_modeling_src_geometries_types.Geom3;
81
127
  declare function SheetMetal({ color, ...props }: SheetMetalProps): react_jsx_runtime.JSX.Element;
82
128
 
83
- /** Indexed triangles, counterclockwise from outside; millimeters, Z up. */
84
- interface SpurGearMesh {
85
- positions: number[];
86
- indices: number[];
87
- }
88
- /**
89
- * An external involute spur gear with its lower face at Z=0. Tooth centers
90
- * start on +X and rotate counterclockwise with phase. The optional hub extends
91
- * above the upper face, and the round bore passes through both gear and hub.
92
- * Flanks are sampled involutes; tips and root valleys follow circular arcs.
93
- * Below the base circle the flanks extend radially, without a generated
94
- * trochoidal root fillet or cutter undercut. No CSG or renderer is required.
95
- */
96
- declare function createSpurGearMesh(input: SpurGearModelPropsInput): SpurGearMesh;
97
-
98
- type HelicalGearMesh = SpurGearMesh;
99
- /**
100
- * Twisted transverse involute teeth from Z=0 to faceWidth, with a stationary
101
- * round bore and optional hub. Zero helix angle reproduces the spur mesh.
102
- */
103
- declare function createHelicalGearMesh(input: HelicalGearModelPropsInput): HelicalGearMesh;
104
-
105
- type HelicalGearProps = HelicalGearModelPropsInput & {
106
- color?: string;
107
- };
108
- /** Axis +Z, lower face Z=0; optional hub extends above the gear face. */
109
- declare function createHelicalGearGeom(input: HelicalGearModelPropsInput): _jscad_modeling_src_geometries_types.Geom3;
110
- declare function HelicalGear({ color, ...props }: HelicalGearProps): react_jsx_runtime.JSX.Element;
111
-
112
129
  type SpurGearProps = SpurGearModelPropsInput & {
113
130
  color?: string;
114
131
  };
@@ -136,23 +153,6 @@ type WormGearProps = WormGearModelPropsInput & {
136
153
  declare function createWormGearGeom(input: WormGearModelPropsInput): _jscad_modeling_src_geometries_types.Geom3;
137
154
  declare function WormGear({ color, ...props }: WormGearProps): react_jsx_runtime.JSX.Element;
138
155
 
139
- interface HexBoltMeshOptions {
140
- radialSegments?: number;
141
- threadStepsPerTurn?: number;
142
- }
143
- /** Outward-oriented, welded indexed surface, in millimeters. */
144
- interface HexBoltMesh {
145
- positions: number[];
146
- indices: number[];
147
- }
148
- declare function createHexBoltMesh(input: HexBoltModelPropsInput, options?: HexBoltMeshOptions): HexBoltMesh;
149
-
150
- type HexBoltProps = HexBoltModelPropsInput & {
151
- color?: string;
152
- };
153
- declare function createHexBoltGeom(input: HexBoltModelPropsInput, options?: HexBoltMeshOptions): _jscad_modeling_src_geometries_types.Geom3;
154
- declare function HexBolt({ color, ...props }: HexBoltProps): react_jsx_runtime.JSX.Element;
155
-
156
156
  declare function getJscadModelForFootprint(footprint: string, jscad: typeof jscadModeling): RenderResult;
157
157
  declare function getJscadModelForFootprintWithPads(footprint: string, jscad: typeof jscadModeling): RenderResult;
158
158
  declare function createJSCADRenderer(jscad: typeof jscadModeling): {