Parametrix's logo

Parametrix

Parametrix's logo Parametrix's logo Parametrix's logo Parametrix's logo
Technical drawing --- Dessin technique --- Dessin industriel --- 2D parametric designs

Geom's user docs

Workflow

The creation of a 3D part with Parametrix is composed by the following steps:

  1. Idea: brainstorming of the general ideas on a white-board
  2. Concept: With Inkscape draw all relevant faces and sections of the parts and define the parameters
  3. Architecture: Using the Geometrix library, describe in javascrit the 3D parts from the parameters
  4. Sizing: Compute the optimal values of the parameters for your use-case
  5. Export: Apply the parameter values and export the 3D parts

In the traditional approach, the steps 2, 3 and 4 might be merged together. The Parametrix workflow forces addressing those phases separately.

Javascript description

main steps of a Geometrix script

  1. import Geometrix
  2. [Optionally] import other parts
  3. define the list of parameters
  4. create the figures
  5. describe the contruction of the 3D parts
  6. [Optionally] define the links to the parameters of the sub-parts

hierarchy of the description

  1. a 3D part is an assembly of one or several extrusions of figures
  2. a figures consists of one or several contours
  3. a contour is either a circle or a closed path made of lines and arcs

Arrangement of contours

A figure is collection of contours. A contour should never cross itself or an other contour. Two contours are either side-by-side or one-include-the-other.

Depending on the arrangement of the contours, we can define 4 types of figures:

types_of_contour_arrangements.svg

Export options

SVG

A 2D drawing of one of the figures. It can be visualized and edited by inkscape.

inkscape path/to/my/exported/file.svg

DXF

A 2D drawing of one of the figures. It can be visualized and edited by librecad.

librecad path/to/my/exported/file.dxf

OpenSCAD

  1. install OpenSCAD
  2. run the exported script: openscad path/to/exported-script.scad
  3. press F6 or click on the menu design>render
openscad path/to/my/exported/file.scad
openscad -o path/to/my3Dfile.stl path/to/my/exported/file.scad
meshlab path/to/my3Dfile.stl

OpenJSCAD

Open the exported script with OpenJSCAD or use the CLI.

mkdir work_with_jscad
cd work_with_jscad
npm install -D @jscad/cli
npx jscad -v
npx jscad
npx jscad path/to/my/exported/file.js
npx jscad path/to/my/exported/file.js -o path/to/my3Dfile.stl
meshlab path/to/my3Dfile.stl

OpenJSCAD doesn’t support parallel contours. If a figure contains several outer contours, they must be extruded one by one independently and then combined together with union.

glTF

  1. Install gltf-transform
  2. Execute the exported script
  3. Visualize the generated gltf-file with this gltf-viewer

Technical details

Notes on Part-name

Two design-definition could have the same partName. This is not recommended but possible. In this case if they have parameters with identical name, their values will be shared. Also the map (partName: link) will allow you defining a single link per partName. So one of your design-definition can not be pointed by the link.

SVG files

The svg-files that described a design and its parameters are not embedded in the design library. The SVG files associated to the designs you want to bind to your WebUI must be manually copy from the sources to the static folder of your sveltekit project.

Failed experiment of embedding the svg-files

There was an attempt to inline those svg-files into the typescript-library using svgfiles2js. The size of the library becomes at least five time larger and svelte complained about the usage of {@html } and the size of the bundles. So this experiment has been abandonned and reverted (commit d1517c13^..d566729d).

git diff --name-only d1517c13^..d566729d

Other idea for embedding the svg-files

An other way of embedding the svg-files in the design library would be to create a companion nodejs-CLI-tool that contains the svg-files and writes them in the target WebUI. So each design library would consist of the browser/nodejs library and the companion nodejs-cli-app for transferring the svg-files.

design-library organisation

The npm-package of a design-library is stored in mono-repo even if we have a single library. This is because paxApps added with degit will bring additional npm-packages (paxScr, desiXY-cli, desiXY-ui and desiXY-uis).

In a design library, you can create sub-folders. Each folder has its own svg folder.

file_structure_single.svg

If you have many designs and you want to distribute them in several packages, then you can create several design-libraries in your mono-repo.

file_structure_several.svg