feat: integrate SimpleCADAPI 2.0.2 CAD workflows
This commit is contained in:
@@ -4,12 +4,12 @@ This index includes generated docs for standard part factory functions. Use thes
|
||||
|
||||
## Import Surfaces
|
||||
|
||||
- Recommended package-level module export: `import simplecadapi as scad`, then call functions through submodules such as `scad.std.gear.<function>(...)` and `scad.std.bearing.<function>(...)`.
|
||||
- Recommended package-level module export: `import simplecadapi as scad`, then call functions through submodules such as `scad.std.gear.<function>(...)`, `scad.std.fastener.<function>(...)`, and `scad.std.bearing.<function>(...)`.
|
||||
- Direct submodule import is also supported, for example `from simplecadapi.std.gear import make_spur_gear_rsolid` or `from simplecadapi.std.bearing import make_ball_bearing_rassembly`.
|
||||
|
||||
## Usage Guidance
|
||||
|
||||
- Prefer standard-library factories for standard bearings, gears, ring gears, and racks before hand-modeling profiles with core geometry APIs.
|
||||
- Prefer standard-library factories for standard bearings, fasteners, spur gears, straight bevel gears, ring gears, and racks before hand-modeling profiles with core geometry APIs.
|
||||
- Standard parts return normal SimpleCAD shapes or product assemblies, so they can be transformed, tagged, assembled, exported, or combined with core geometry operations.
|
||||
- Switch to core geometry APIs only when the requested standard part needs substantial custom geometry beyond the factory parameters.
|
||||
|
||||
@@ -23,6 +23,19 @@ This index includes generated docs for standard part factory functions. Use thes
|
||||
- [make_herringbone_gear_rsolid](make_herringbone_gear_rsolid.md) *(from std/gear.py)* `stdlib`
|
||||
- [make_spur_gear_rsolid](make_spur_gear_rsolid.md) *(from std/gear.py)* `stdlib`
|
||||
|
||||
## Bevel Gears
|
||||
|
||||
- [make_straight_bevel_gear_rsolid](make_straight_bevel_gear_rsolid.md) *(from std/gear.py)* `stdlib`
|
||||
|
||||
## Roller Chain
|
||||
|
||||
- [make_roller_chain_sprocket_rsolid](make_roller_chain_sprocket_rsolid.md) *(from std/chain.py)* `stdlib`
|
||||
|
||||
## Fasteners
|
||||
|
||||
- [make_bolt_rsolid](make_bolt_rsolid.md) *(from std/fastener.py)* `stdlib`
|
||||
- [make_nut_rsolid](make_nut_rsolid.md) *(from std/fastener.py)* `stdlib`
|
||||
|
||||
## Internal Ring Gears
|
||||
|
||||
- [make_helical_ring_gear_rsolid](make_helical_ring_gear_rsolid.md) *(from std/gear.py)* `stdlib`
|
||||
|
||||
@@ -0,0 +1,41 @@
|
||||
# make_bolt_rsolid
|
||||
|
||||
## API Definition
|
||||
|
||||
```python
|
||||
def make_bolt_rsolid(
|
||||
diameter: float,
|
||||
length: float,
|
||||
head_style: str = "hex",
|
||||
thread_style: str = "auto",
|
||||
thread_detail: str = "modeled",
|
||||
thread_form: str = "v",
|
||||
thread_pitch: Optional[float] = None,
|
||||
thread_depth: Optional[float] = None,
|
||||
thread_length: Optional[float] = None,
|
||||
head_width: Optional[float] = None,
|
||||
head_height: Optional[float] = None,
|
||||
drive_style: str = "none",
|
||||
drive_size: Optional[float] = None,
|
||||
drive_depth: Optional[float] = None,
|
||||
underhead_fillet_radius: Optional[float] = None,
|
||||
) -> Solid
|
||||
```
|
||||
|
||||
*Source: std/fastener.py*
|
||||
|
||||
## Import Surface
|
||||
|
||||
- standard library: `import simplecadapi as scad` then `scad.std.fastener.make_bolt_rsolid(...)`; direct submodule import: `from simplecadapi.std.fastener import make_bolt_rsolid`
|
||||
|
||||
## Description
|
||||
|
||||
Create a parameterized bolt along `+Z`, with the head underside on `Z=0`. Head styles are `hex`, `square`, `cylindrical`, `button`, and `countersunk`. Drive styles are `none`, `slot`, `cross`, and `hex_socket`.
|
||||
|
||||
Thread styles are `auto`, `full`, `partial`, and `none`. `auto` selects full thread for `length <= 3 * diameter`; otherwise it uses the ISO-style piecewise partial-thread length. The default `thread_detail="modeled"` creates a visible replayable helical `v` or `trapezoidal` thread. Set `thread_detail="cosmetic"` explicitly for a smooth shank with thread intent only in metadata. For partial threads, `thread_length` is measured back from the tip at `Z=length`.
|
||||
|
||||
For metric coarse-series diameters, the factory derives the default pitch from the standard series and records `d2 = d - 0.6495P` and `d1 = d - 1.0825P` in metadata. Hex-head defaults use catalog-like `S` and `k` values where available. The default underhead fillet is `0.06d`; `underhead_fillet_radius` can override it. The metadata also reports a minimum recommended mating-hole chamfer equal to the fillet radius.
|
||||
|
||||
Modeled threads may rotate the helical seam to an equivalent kernel-stable phase. The selected phase is recorded as `thread_phase_degrees` in `std.fastener.bolt` metadata and does not change thread dimensions or handedness.
|
||||
|
||||
Default dimensions are useful parametric proportions, not a claim of compliance with a specific ISO, DIN, ASME, or supplier catalog. Set catalog dimensions explicitly for released hardware.
|
||||
@@ -16,10 +16,9 @@ def make_helical_gear_rsolid(n_teeth: int, module: float, pressure_angle: float
|
||||
|
||||
Create an involute helical gear.
|
||||
|
||||
Non-zero helix angles are modeled as small-step ruled lofts through rotated
|
||||
copies of one profile. The small angular step keeps closed-wire section
|
||||
correspondence stable while ruled faces avoid smooth loft bulging in STEP
|
||||
exports.
|
||||
Non-zero helix angles use a continuous twisted sweep along the gear axis. An
|
||||
auxiliary-spine rotation law preserves the profile while generating one
|
||||
continuous side face per profile edge instead of one face per loft interval.
|
||||
|
||||
## Parameters
|
||||
|
||||
|
||||
@@ -16,10 +16,8 @@ def make_herringbone_gear_rsolid(n_teeth: int, module: float, pressure_angle: fl
|
||||
|
||||
Create an involute herringbone (double-helical) gear.
|
||||
|
||||
Each half is modeled as a small-step ruled loft through rotated copies of
|
||||
one profile, with a shared center section forming the herringbone ridge.
|
||||
This keeps closed-wire section correspondence stable while avoiding smooth
|
||||
loft bulging in STEP exports.
|
||||
Each half uses a continuous twisted sweep with opposite handedness. The two
|
||||
halves share the rotated center profile and are fused into one solid.
|
||||
|
||||
## Parameters
|
||||
|
||||
|
||||
@@ -0,0 +1,35 @@
|
||||
# make_nut_rsolid
|
||||
|
||||
## API Definition
|
||||
|
||||
```python
|
||||
def make_nut_rsolid(
|
||||
diameter: float,
|
||||
width: float,
|
||||
height: float,
|
||||
nut_style: str = "hex",
|
||||
hole_style: str = "through",
|
||||
thread_detail: str = "modeled",
|
||||
thread_form: str = "v",
|
||||
thread_pitch: Optional[float] = None,
|
||||
thread_depth: Optional[float] = None,
|
||||
hole_depth: Optional[float] = None,
|
||||
knurl_count: int = 24,
|
||||
) -> Solid
|
||||
```
|
||||
|
||||
*Source: std/fastener.py*
|
||||
|
||||
## Import Surface
|
||||
|
||||
- standard library: `import simplecadapi as scad` then `scad.std.fastener.make_nut_rsolid(...)`; direct submodule import: `from simplecadapi.std.fastener import make_nut_rsolid`
|
||||
|
||||
## Description
|
||||
|
||||
Create a parameterized nut along `+Z`, with its bottom face on `Z=0`. Nut styles are `hex`, `square`, `round`, and `knurled`. Hole styles are `through` and `blind`; a blind hole opens from the top face and uses `hole_depth` as its axial depth.
|
||||
|
||||
The default `thread_detail="modeled"` creates replayable internal `v` or `trapezoidal` helical teeth. Set `thread_detail="cosmetic"` explicitly for a smooth major-diameter hole with thread intent only in metadata. For metric coarse-series diameters, the factory derives the default pitch and records `d2 = d - 0.6495P` and `d1 = d - 1.0825P` in metadata. `knurl_count` controls the lobe count of the printable knurled approximation.
|
||||
|
||||
Modeled threads may rotate the helical seam to an equivalent kernel-stable phase. The selected phase is recorded as `thread_phase_degrees` in `std.fastener.nut` metadata and does not change thread dimensions or handedness.
|
||||
|
||||
Default thread proportions are useful for parametric models, not a substitute for catalog tolerances, thread class, lead-in, prevailing-torque features, or manufacturing checks.
|
||||
@@ -0,0 +1,19 @@
|
||||
# make_roller_chain_sprocket_rsolid
|
||||
|
||||
## API Definition
|
||||
|
||||
```python
|
||||
def make_roller_chain_sprocket_rsolid(n_teeth: int, chain_pitch: float, roller_diameter: float, sprocket_thickness: float, *, bore_radius: float = 0.0, roller_clearance: float = 0.15) -> Solid
|
||||
```
|
||||
|
||||
*Source: std/chain.py*
|
||||
|
||||
## Import Surface
|
||||
|
||||
- standard library: `import simplecadapi as scad` then `scad.std.chain.make_roller_chain_sprocket_rsolid(...)`; direct submodule import: `from simplecadapi.std.chain import make_roller_chain_sprocket_rsolid`
|
||||
|
||||
## Description
|
||||
|
||||
Create a roller-chain sprocket from tooth count, chain pitch, roller diameter, and tooth-plate thickness. The pitch radius follows the regular pitch polygon. Circular roller seats are cut at every pitch point and opened through the engineering outside-diameter envelope.
|
||||
|
||||
The result preserves assembly-level engagement dimensions. Manufacturing release still requires the selected chain standard's permitted tooth-form range, tooth width, hub, material, heat treatment, runout, and supplier checks.
|
||||
@@ -0,0 +1,30 @@
|
||||
# make_straight_bevel_gear_rsolid
|
||||
|
||||
## API Definition
|
||||
|
||||
```python
|
||||
def make_straight_bevel_gear_rsolid(n_teeth: int, module: float, pitch_angle: float = 45.0, pressure_angle: float = 20.0, face_width: float = 8.0, *, addendum_factor: float = 1.0, clearance_factor: float = 0.25, backlash: float = 0.0) -> Solid
|
||||
```
|
||||
|
||||
*Source: std/gear.py*
|
||||
|
||||
## Import Surface
|
||||
|
||||
- standard library: `import simplecadapi as scad` then `scad.std.gear.make_straight_bevel_gear_rsolid(...)`; direct submodule import: `from simplecadapi.std.gear import make_straight_bevel_gear_rsolid`
|
||||
|
||||
## Description
|
||||
|
||||
Create a straight bevel gear with standard metric tooth proportions. The large-end transverse section uses an analytic involute profile. A similar small-end section is placed on the pitch cone and connected with ruled straight tooth surfaces.
|
||||
|
||||
The returned solid contains nominal tooth geometry. Releasing a mating pair still requires mounting-distance, contact-pattern, backlash, material, heat-treatment, and strength checks.
|
||||
|
||||
## Parameters
|
||||
|
||||
- `n_teeth`: Number of teeth, at least 3.
|
||||
- `module`: Large-end transverse module in millimetres.
|
||||
- `pitch_angle`: Pitch-cone angle in degrees, greater than 0 and less than 90.
|
||||
- `pressure_angle`: Transverse pressure angle in degrees.
|
||||
- `face_width`: Tooth face width along the pitch-cone generator in millimetres; must be smaller than the outer pitch-cone distance.
|
||||
- `addendum_factor`: Large-end tooth addendum divided by module.
|
||||
- `clearance_factor`: Root clearance beyond the addendum divided by module.
|
||||
- `backlash`: Large-end circumferential tooth-thickness reduction at the pitch circle in millimetres.
|
||||
Reference in New Issue
Block a user