OpenJSCAD.org icon indicating copy to clipboard operation
OpenJSCAD.org copied to clipboard

Idea: functions to generate the stroke of a path or geom2

Open platypii opened this issue 1 year ago • 1 comments

We should introduce functions to generate the stroke of a path.

stroke

Such functions could be useful for creating the exterior of a shape from a given path. There are cases where having only the path is not enough and one might need to add "thiccness". This could also be helpful for things like importing SVGs which can have both fill and stroke.

For paths, this functionality would essentially be offset. However, there is currently no straightforward way to compute the stroke of a geom2.

Options for stroking a path, from the svg spec:

  • width
  • cap: butt | round | square
  • join: arcs | bevel |miter | miter-clip | round
  • miterlimit

platypii avatar Jul 18 '23 04:07 platypii

Maybe a little more primitive, the WebAPI provides both CanvasRenderingContext2D and Path2D interfaces for constructing 2D paths for rendering. Maybe some of these concepts could be adopted.

z3dev avatar Dec 24 '23 02:12 z3dev