jscad-electronics 0.0.188 → 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/cables.d.ts +4 -0
- package/dist/cables.js +26 -3
- package/dist/cables.js.map +1 -1
- package/dist/index.d.ts +182 -182
- package/dist/index.js +8318 -8030
- package/dist/index.js.map +1 -1
- package/dist/vanilla.d.ts +62 -60
- package/dist/vanilla.js +8285 -7971
- package/dist/vanilla.js.map +1 -1
- package/package.json +19 -13
package/dist/vanilla.d.ts
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
|
+
import { MaterialOptions } from 'jscad-fiber';
|
|
1
2
|
import { BufferGeometry } from 'three';
|
|
2
3
|
import * as jscadModeling from '@jscad/modeling';
|
|
3
4
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
4
|
-
import { NemaMotorModelPropsInput, HexSocketBoltModelPropsInput, SheetMetalModelPropsInput, SpurGearModelPropsInput, HelicalGearModelPropsInput, WormGearModelPropsInput, HexBoltModelPropsInput } from '@tscircuit/modelprinter';
|
|
5
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';
|
|
6
7
|
|
|
7
8
|
type VNode = {
|
|
8
9
|
type: any;
|
|
@@ -17,6 +18,7 @@ type Color = string | [number, number, number] | [number, number, number, number
|
|
|
17
18
|
type ColoredGeom = {
|
|
18
19
|
geom: any;
|
|
19
20
|
color?: Color;
|
|
21
|
+
material?: MaterialOptions;
|
|
20
22
|
};
|
|
21
23
|
type RenderResult = {
|
|
22
24
|
geometries: ColoredGeom[];
|
|
@@ -24,20 +26,51 @@ type RenderResult = {
|
|
|
24
26
|
|
|
25
27
|
declare function convertCSGToThreeGeom(csg: any): BufferGeometry;
|
|
26
28
|
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
*
|
|
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.
|
|
36
41
|
*/
|
|
37
|
-
declare function
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
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;
|
|
41
74
|
|
|
42
75
|
/** Indexed triangles, counterclockwise from outside; millimeters, Z up. */
|
|
43
76
|
interface HexSocketBoltMesh {
|
|
@@ -59,6 +92,21 @@ type HexSocketBoltProps = HexSocketBoltModelPropsInput & {
|
|
|
59
92
|
declare function createHexSocketBoltGeom(input: HexSocketBoltModelPropsInput): _jscad_modeling_src_geometries_types.Geom3;
|
|
60
93
|
declare function HexSocketBolt({ color, ...props }: HexSocketBoltProps): react_jsx_runtime.JSX.Element;
|
|
61
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
|
+
|
|
62
110
|
interface SheetMetalMesh {
|
|
63
111
|
positions: number[];
|
|
64
112
|
indices: number[];
|
|
@@ -78,35 +126,6 @@ type SheetMetalProps = SheetMetalModelPropsInput & {
|
|
|
78
126
|
declare function createSheetMetalGeom(input: SheetMetalModelPropsInput): _jscad_modeling_src_geometries_types.Geom3;
|
|
79
127
|
declare function SheetMetal({ color, ...props }: SheetMetalProps): react_jsx_runtime.JSX.Element;
|
|
80
128
|
|
|
81
|
-
/** Indexed triangles, counterclockwise from outside; millimeters, Z up. */
|
|
82
|
-
interface SpurGearMesh {
|
|
83
|
-
positions: number[];
|
|
84
|
-
indices: number[];
|
|
85
|
-
}
|
|
86
|
-
/**
|
|
87
|
-
* An external involute spur gear with its lower face at Z=0. Tooth centers
|
|
88
|
-
* start on +X and rotate counterclockwise with phase. The optional hub extends
|
|
89
|
-
* above the upper face, and the round bore passes through both gear and hub.
|
|
90
|
-
* Flanks are sampled involutes; tips and root valleys follow circular arcs.
|
|
91
|
-
* Below the base circle the flanks extend radially, without a generated
|
|
92
|
-
* trochoidal root fillet or cutter undercut. No CSG or renderer is required.
|
|
93
|
-
*/
|
|
94
|
-
declare function createSpurGearMesh(input: SpurGearModelPropsInput): SpurGearMesh;
|
|
95
|
-
|
|
96
|
-
type HelicalGearMesh = SpurGearMesh;
|
|
97
|
-
/**
|
|
98
|
-
* Twisted transverse involute teeth from Z=0 to faceWidth, with a stationary
|
|
99
|
-
* round bore and optional hub. Zero helix angle reproduces the spur mesh.
|
|
100
|
-
*/
|
|
101
|
-
declare function createHelicalGearMesh(input: HelicalGearModelPropsInput): HelicalGearMesh;
|
|
102
|
-
|
|
103
|
-
type HelicalGearProps = HelicalGearModelPropsInput & {
|
|
104
|
-
color?: string;
|
|
105
|
-
};
|
|
106
|
-
/** Axis +Z, lower face Z=0; optional hub extends above the gear face. */
|
|
107
|
-
declare function createHelicalGearGeom(input: HelicalGearModelPropsInput): _jscad_modeling_src_geometries_types.Geom3;
|
|
108
|
-
declare function HelicalGear({ color, ...props }: HelicalGearProps): react_jsx_runtime.JSX.Element;
|
|
109
|
-
|
|
110
129
|
type SpurGearProps = SpurGearModelPropsInput & {
|
|
111
130
|
color?: string;
|
|
112
131
|
};
|
|
@@ -134,23 +153,6 @@ type WormGearProps = WormGearModelPropsInput & {
|
|
|
134
153
|
declare function createWormGearGeom(input: WormGearModelPropsInput): _jscad_modeling_src_geometries_types.Geom3;
|
|
135
154
|
declare function WormGear({ color, ...props }: WormGearProps): react_jsx_runtime.JSX.Element;
|
|
136
155
|
|
|
137
|
-
interface HexBoltMeshOptions {
|
|
138
|
-
radialSegments?: number;
|
|
139
|
-
threadStepsPerTurn?: number;
|
|
140
|
-
}
|
|
141
|
-
/** Outward-oriented, welded indexed surface, in millimeters. */
|
|
142
|
-
interface HexBoltMesh {
|
|
143
|
-
positions: number[];
|
|
144
|
-
indices: number[];
|
|
145
|
-
}
|
|
146
|
-
declare function createHexBoltMesh(input: HexBoltModelPropsInput, options?: HexBoltMeshOptions): HexBoltMesh;
|
|
147
|
-
|
|
148
|
-
type HexBoltProps = HexBoltModelPropsInput & {
|
|
149
|
-
color?: string;
|
|
150
|
-
};
|
|
151
|
-
declare function createHexBoltGeom(input: HexBoltModelPropsInput, options?: HexBoltMeshOptions): _jscad_modeling_src_geometries_types.Geom3;
|
|
152
|
-
declare function HexBolt({ color, ...props }: HexBoltProps): react_jsx_runtime.JSX.Element;
|
|
153
|
-
|
|
154
156
|
declare function getJscadModelForFootprint(footprint: string, jscad: typeof jscadModeling): RenderResult;
|
|
155
157
|
declare function getJscadModelForFootprintWithPads(footprint: string, jscad: typeof jscadModeling): RenderResult;
|
|
156
158
|
declare function createJSCADRenderer(jscad: typeof jscadModeling): {
|