Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 6 additions & 5 deletions src/parametric/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ It runs entirely in the browser. The geometry kernel is OpenCascade compiled to
- Fillet, chamfer (equal distance, two distances, distance and angle), shell, draft.
- Holes: simple, counterbored and countersunk, placed by clicking faces.
- Linear patterns (one or two directions), circular patterns and mirroring.
- Reference planes, STEP import.
- Reference planes, STEP and IGES import. IGES trimmed surfaces are sewn into solids; B-spline surfaces that are really planes, cylinders, cones, spheres or tori come in as those, so holes and fillets stay recognizable.
- Open SolidWorks parts (.sldprt, SolidWorks 2003 and later) without SolidWorks: the exact solid is read from the file and becomes an imported body you can keep modeling on. The SolidWorks feature tree is not carried over.
- References to faces and edges are stored by name, so fillets and sketches on faces survive dimension changes.

Expand All @@ -52,12 +52,12 @@ It runs entirely in the browser. The geometry kernel is OpenCascade compiled to
- Cut list in the design tree: identical members grouped with quantity, description, length, end angles and mass, exported as CSV.

**Assemblies**
- File > New Assembly. Insert Components places parts from your cloud, this browser or your device (a part file or a STEP model); insert a part several times for several instances (bracket<1>, bracket<2>). The first component is fixed; the others float.
- File > New Assembly. Insert Components places parts from your cloud, this browser or your device (a part file, or a STEP or IGES model); insert a part several times for several instances (bracket<1>, bracket<2>). The first component is fixed; the others float.
- Mates: coincident, parallel, perpendicular, distance, angle, concentric, tangent and lock, between faces, edges and the assembly planes, with aligned or anti-aligned alignment and values that take equations. Distance and angle mates can be limited to a range instead of a value (the component moves freely between a minimum and a maximum). The Mates folder in the design tree edits, flips, suppresses and deletes them. The status bar shows whether the assembly is under, fully or over defined; conflicting mates are marked.
- Mechanical mates: hinge (concentric and coincident in one, with optional angle limits from where it was added), slider (a straight edge or axis, or two planar faces, on each component: one move along it and no turn, with optional travel limits), gear (two axes turning by a ratio of pitch diameters or teeth, reversible for internal gears), rack and pinion (the rack's travel by the pinion's pitch diameter or a distance per turn), screw (a nut travelling a pitch per turn, right- or left-hand), width (a tab centred in a groove), slot (a pin travelling along a slot between its ends), cam follower (a vertex, a roller or a flat face kept on the cam's profile faces as it turns; convex profiles, exactly for round faces; a profile with a hollow is refused with its depth) and universal joint (two shafts at an angle β, the output turning by atan(tan φ / cos β), with an optional joint point where their axes meet). Gear, rack and screw mates hold from wherever the components are when they are added, and their turns add up past a full turn.
- Drag a component (Alt+drag, or Rotate Component, turns it): it moves only as its mates allow, so a lid on a hinge pin turns about the pin, turning one gear turns the other, dragging a rack turns its pinion, and a drag stops at a mate's limits. Fixed components do not move.
- Motion studies (Motion Study): rotary motors (a constant speed in °/s or rpm, or oscillating; on a face or edge, or on a hinge), linear motors (constant speed or oscillating; along a face or edge, or on a slider) and mate drivers (a distance or angle mate's value at a constant speed, harmonic, or ramped between two values) drive the mechanism for a duration at a frame rate. Frames are calculated without freezing the interface (with progress, and a Cancel); the study stops and says why when a limit is reached or the mechanism locks up. Play, pause, loop and scrub through the motion; plot a point of a component (its displacement, velocity, acceleration, or its turn, angular velocity and acceleration) or what a mate measures against time, download the results as CSV, and check the frames for interference. Studies are listed in the design tree and saved with the assembly; editing the assembly puts their results out of date.
- Exploded view steps, interference detection with the overlapping volumes, a bill of materials (item, part, quantity, material; copy or download as CSV), mass properties with each part's material, measure, section view, and STEP (components as named solids) and STL export of the whole assembly.
- Exploded view steps, interference detection with the overlapping volumes, a bill of materials (item, part, quantity, material; copy or download as CSV), mass properties with each part's material, measure, section view, and STEP (components as named solids), IGES (components as named, colored groups) and STL export of the whole assembly.
- An assembly references its part files and keeps a copy of each, so it opens even when a part file is moved, shared or downloaded. Open Part edits a component's part; save it and go back, and the assembly takes the change (Update Parts reads the part files again).

**Assistant**
Expand Down Expand Up @@ -98,8 +98,8 @@ It runs entirely in the browser. The geometry kernel is OpenCascade compiled to
- Global variables and equations: type `=Width/2` in any dimension or feature value.
- Material and appearance, mass properties (mass, volume, area, center of mass, inertia), measure, section view.
- Display styles (shaded with edges, shaded, hidden lines removed or visible, wireframe), standard views, perspective.
- Save to your Puter cloud or this browser, crash recovery of unsaved work, export STEP and STL, download the part file.
- Open parts, STEP and SolidWorks files from the Puter desktop (double-click or Open with), or drag them onto the app from a Puter folder window or your computer. Files dragged onto the assistant go with your next message.
- Save to your Puter cloud or this browser, crash recovery of unsaved work, export STEP, IGES (trimmed NURBS surfaces, with each boundary in model space and on its surface) and STL, download the part file.
- Open parts, STEP, IGES and SolidWorks files from the Puter desktop (double-click or Open with), or drag them onto the app from a Puter folder window or your computer. Files dragged onto the assistant go with your next message.
- Share parts saved in your Puter cloud with other Puter users, with view or edit access. Parts shared with you appear under **Shared with me** in the Open dialog.
- Undo and redo for everything, including sketch edits.
- Light, dark and system themes. Works with mouse, trackpad, touch and keyboard, from phones to large desktop screens.
Expand Down Expand Up @@ -134,6 +134,7 @@ npm run build # type check, license check, production build in dist/
| Geometry kernel | `src/kernel` | OpenCascade (WebAssembly) in a Web Worker. Each feature is cached under a hash of everything before it, so edits rebuild only what changed. Faces are named after the feature and sketch entity that created them. |
| Renderer | `src/render` | WebGL2: shaded meshes with per-face state in a data texture, screen-space thick edges, GPU picking with depth (asynchronous readback for hover), section clipping, render on demand. |
| Interface | `src/app`, `src/ui` | No framework. CommandManager, design tree, PropertyManager panels, sketch editor, dialogs. |
| IGES | `src/formats/iges`, `src/kernel/iges.ts` | Writes every face as an exact rational B-spline trimmed surface (144 over 128, boundaries as 142 with model-space and parameter-space curves). Reads trimmed and bounded surfaces, analytic surfaces, B-rep solids (186) and subfigures, converts them to STEP for the kernel's reader, and sews the faces into solids. Runs in the geometry worker. |
| SolidWorks import | `src/formats/sldprt` | Reads the SolidWorks container (2015+ chunk format and the older OLE2), decodes the embedded Parasolid transmit and writes it as exact STEP for the kernel. Runs in the geometry worker. |
| CAM | `src/model/cam.ts`, `src/cam`, `src/app/cam` | Toolpaths are generated in a worker of their own from a fine mesh of the part, in the setup's work coordinates. Drop-cutter (`src/cam/dropcutter.ts`) gives the lowest height a flat, ball, bull nose or conical cutter can reach at a point (face, edge and corner contacts, exact where a closed form exists). Where the tool can be at a height is where that is lower: its boundary is traced by marching squares with each crossing refined by bisection on the drop-cutter, and the passes inside it are offsets of a distance transform, cut from the innermost out. Parallel finishing follows drop-cutter heights along lines. The simulation lowers a height map of the stock along every move. Post processors write the moves with arcs fitted to them. |
| Analysis | `src/model/fea.ts`, `src/fea`, `src/app/fea` | Static stress analysis in a worker of its own, loaded on first use. The mesher (`src/fea/mesher.ts`) fills the solid with a body-centred cubic lattice (isosurface stuffing: exact inside tests by ray crossings of the kernel's triangulation, lattice points near the boundary warped onto it, lattice tetrahedra clipped with fixed stencils), moves vertices onto the part's corners and onto the edges between faces (splitting edges where a move would spoil an element), smooths, and adds midside nodes on the curved surface. The solver assembles 10-node tetrahedra into node-block sparse rows, applies fixtures as constraints in each node's own frame, and solves with conjugate gradients preconditioned by smoothed aggregation multigrid (rigid body modes as the near null space; block Gauss-Seidel smoothing). Fixtures are checked against rigid body motions before solving. |
Expand Down
2 changes: 1 addition & 1 deletion src/parametric/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, viewport-fit=cover" />
<title>Parametric</title>
<meta name="description" content="Parametric is an open-source 3D CAD app for feature-based part modeling in your browser: constrained sketches, extrudes, revolves, fillets, shells, holes and patterns on a real B-rep kernel, with STEP and STL export." />
<meta name="description" content="Parametric is an open-source 3D CAD app for feature-based part modeling in your browser: constrained sketches, extrudes, revolves, fillets, shells, holes and patterns on a real B-rep kernel, with STEP, IGES and STL export." />
<link rel="canonical" href="https://parametric.puter.com/" />
<meta name="theme-color" content="#f7f8fa" media="(prefers-color-scheme: light)" />
<meta name="theme-color" content="#1f2226" media="(prefers-color-scheme: dark)" />
Expand Down
2 changes: 1 addition & 1 deletion src/parametric/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "parametric",
"version": "0.1.0",
"description": "Parametric: feature-based 3D part modeling in the browser. Sketch with constraints, extrude, revolve, fillet, shell and pattern on a real B-rep kernel, then export STEP and STL or machine it with CAM toolpaths and G-code, stored in your own Puter cloud.",
"description": "Parametric: feature-based 3D part modeling in the browser. Sketch with constraints, extrude, revolve, fillet, shell and pattern on a real B-rep kernel, then export STEP, IGES and STL or machine it with CAM toolpaths and G-code, stored in your own Puter cloud.",
"type": "module",
"private": true,
"license": "AGPL-3.0-only",
Expand Down
7 changes: 4 additions & 3 deletions src/parametric/src/app/actions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -148,13 +148,14 @@ export function registerCommands(app: App, files: FileOps) {
// ---- file ----
{ id: 'new', label: 'New', icon: 'new', shortcut: 'Control+N', description: 'Start a new part.', run: () => files.newPart() },
{ id: 'open', label: 'Open...', icon: 'open', shortcut: 'Ctrl+O', description: 'Open a saved part.', run: () => files.open() },
{ id: 'openDevice', label: 'Open from Device...', icon: 'upload', description: 'Open a part file, or a STEP or SolidWorks file, from this device.', run: () => files.openFromDevice() },
{ id: 'openDevice', label: 'Open from Device...', icon: 'upload', description: 'Open a part file, or a STEP, IGES or SolidWorks file, from this device.', run: () => files.openFromDevice() },
{ id: 'save', label: 'Save', icon: 'save', shortcut: 'Ctrl+S', description: 'Save the part.', run: () => { void files.save(); } },
{ id: 'saveAs', label: 'Save As...', icon: 'save', shortcut: 'Ctrl+Shift+S', run: () => files.saveAs() },
{ id: 'downloadPart', label: 'Download Part File', icon: 'download', description: 'Download the part file to this device.', run: () => files.exportAs('part') },
{ id: 'exportStep', label: 'Export STEP...', icon: 'export', keywords: 'stp export cad', description: 'Export the solid as a STEP file.', enabled: hasBody, run: () => files.exportAs('step') },
{ id: 'exportIges', label: 'Export IGES...', icon: 'export', keywords: 'igs iges export cad surfaces', description: 'Export the solid as an IGES file (trimmed NURBS surfaces).', enabled: hasBody, run: () => files.exportAs('iges') },
{ id: 'exportStl', label: 'Export STL...', icon: 'export', keywords: '3d print mesh', description: 'Export the solid as an STL mesh for 3D printing.', enabled: hasBody, run: () => files.exportAs('stl') },
{ id: 'importStep', label: 'Import...', icon: 'import', keywords: 'stp step sldprt solidworks import', description: 'Insert a STEP file or SolidWorks part as a solid body.', run: () => files.importStep() },
{ id: 'importStep', label: 'Import...', icon: 'import', keywords: 'stp step igs iges sldprt solidworks import', description: 'Insert a STEP or IGES file, or a SolidWorks part, as a solid body.', run: () => files.importStep() },
{ id: 'rename', label: 'Rename Part...', icon: 'edit', run: () => files.rename() },
{
id: 'assistant', label: 'Assistant', icon: 'assistant', shortcut: 'Ctrl+J', keywords: 'ai chat copilot design help agent claude',
Expand Down Expand Up @@ -476,7 +477,7 @@ export function buildMenus(app: App): { label: string; items: () => MenuItem[] }
{
label: 'File', items: () => [
m('new'), ...(c.get('newAssembly') ? [m('newAssembly')] : []), m('open'), m('openDevice'), { label: 'Recent', icon: 'files', submenu: () => app.recentMenu() }, sep,
m('save'), m('saveAs'), m('downloadPart'), sep, m('importStep'), m('exportStep'), m('exportStl'), sep, m('openDrawing'), m('drawing:pdf'), m('drawing:dxf'), sep, m('share'), m('rename'), m('properties'),
m('save'), m('saveAs'), m('downloadPart'), sep, m('importStep'), m('exportStep'), m('exportIges'), m('exportStl'), sep, m('openDrawing'), m('drawing:pdf'), m('drawing:dxf'), sep, m('share'), m('rename'), m('properties'),
],
},
{
Expand Down
2 changes: 1 addition & 1 deletion src/parametric/src/app/assembly/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ export const ASSEMBLY_TAB: RibbonTab = {
* measuring...). Every other command is disabled while an assembly is open.
*/
const SHARED = new Set([
'new', 'newAssembly', 'open', 'openDevice', 'save', 'saveAs', 'downloadPart', 'exportStep', 'exportStl', 'rename', 'share', 'properties', 'assistant',
'new', 'newAssembly', 'open', 'openDevice', 'save', 'saveAs', 'downloadPart', 'exportStep', 'exportIges', 'exportStl', 'rename', 'share', 'properties', 'assistant',
'undo', 'redo', 'redo2', 'rebuild', 'forceRebuild', 'repeat', 'delete', 'equations', 'options', 'measure', 'massProperties', 'sectionView',
'zoomFit', 'zoomIn', 'zoomOut', 'previousView', 'normalTo', 'viewOrientation', 'displayStyle', 'toggleVisibility', 'perspective', 'showPlanes', 'showOrigin',
'toggleTree', 'shortcutBar', 'shortcuts', 'shortcutsF1', 'github', 'about', 'openDrawing', 'backToModel',
Expand Down
Loading
Loading