Skip to content

JSCAD V3

Z3 Development edited this page Oct 21, 2023 · 55 revisions

These are thoughts about V3 of JSCAD, which includes API breaking changes across several core libraries. Some of these thoughts may become impractical or undesirable, so consider everything in flux and changing.

In addition, CLI / WEB applications will require changes in order to support the core library changes.

Packages

  • switch to Rollup (replace browserify) to package libraries with UMD / ES6 import bindings
    • NOTE: web UI cannot use Rollup due to webworkify / most libraries
  • publish UMD / ES6 librares

Modeling

Geometry V2 V3 Notes
geom2 { sides: [[vec2, vec2],...] } { outlines: [[vec2, ...], ...] } transforms
geom3 { polygons: [poly3, ...] } { polygons: [poly3, ...] } transforms
path2 { points: [vec2, ...], isClosed: true } { points: [vec2, ...], isClosed: true } transforms
poly2 { vertices: [vec2, ...] } { points: [vec2, ...] }
poly3 { vertices: [vec3, ...] } { vertices: [vec3, ...] }
slice { edges: [[vec3, vec3], ...] } { contours: [[vec3, ...], ...] }
  • NEW add dependency on array-utils (and drop duplicate functions)
  • Rework 2D booleans to use martinez
  • Rework poly2 into a complete geometry
  • Rework geom2 into a list of outlines
  • Rework slice into a list of contours
  • Move slice to geometries
  • Add slice to measurements
  • Remove extrudeRectangular
  • Rework OrthonormaFormula for providing to/from matrices
  • Rework vectorChar() and vectorText() to return array of path2 objects #1067
  • Rework options to vectorChar() and vectorText() to align with the general API
  • Rework extrudeRotate to support axis rotation #1277
  • Rework expand 3D
  • Allow empty / sparse lists in all operations
  • Allow empty geometries in all operations
  • Unify offset and expand, and add a new parameter to control
  • Correct parameter names which are not camelCase
  • Remove axes parameter for ellipsoid
  • Unify poly3.create and poly3.fromPoints
  • Unify geom2.create and geom2.fromPoints
  • NEW union / intersect / subtract for paths (See http://tavmjong.free.fr/INKSCAPE/MANUAL/html/Paths-Combining.html)
  • NEW add support for GLOBAL segments
  • NEW add support for GLOBAL EPS
  • NEW Connectors
    • re-implement as supported geometry (anonymous object form)
      • contains plane, and perpendicular (vector)
      • created from...
        • plane and perpendicular
        • three points (of plane), and perpendicular
        • closest point on GEOMETRY to POINT, and perpendicular
    • adding 'properties' (name, id, etc) is possible
    • usable as parameter to transforms; align, center, mirror, rotate, scale, translate ==> transform(mat4)
  • NEW Curves (See http://verbnurbs.com/ for inspiration)
    • NEW arc
    • NEW nurbs
  • NEW pipeline operation (see https://github.com/jscad/csg.js/issues/114 )

IO Sub-packages

  • Drop GCODE support / code
  • NEW functionality for converting external formats to JSCAD (separate functionality from Core)
  • NEW 3MF deserializer
  • Package all IO libraries as UMD and ES modules
  • Publish all IO libraries

Note: AMF and SCAD packages will be kept but not included until someone ports the code to V3.

Utility Sub-packages

  • move array-utils out of utils
  • package as UMD and ES libraries

Core

  • NEW 'use' function to include / evaluate a single source file (remote loading)
  • Rework evaluation to support async functions, both cli and web
    • cli evaluation requires dynamic import (async)
    • web ??
  • Rework to use NEW IO functionality

CLI Application

  • Rework to call main asynchronous
  • Rework to remove AMF support
  • Rework conversions to deserialize geometries, not source

Web UI Application

  • Create reusable viewer components
  • Rework to call main asynchronous
  • Rework to remove AMF support

Renderer

  • Adjust viewer for geom2 changes
  • NEW conversion and rendering of slice
  • Package as UMD and ES libraries

Website

  • Prepare to host both V2 and V3
    • create V2 hosting area
    • duplicate V2 WEBUI
    • duplicate V2 DOCWIKI
    • create website forward to V2
  • Publish V3
    • create V3 hosting area
    • ...