jscad / OpenJSCAD.org

JSCAD is an open source set of modular, browser and command line tools for creating parametric 2D and 3D designs with JavaScript code. It provides a quick, precise and reproducible method for generating 3D models, and is especially useful for 3D printing applications.
https://openjscad.xyz/
MIT License
2.65k stars 514 forks source link

feat(modeling): reworked vectorChar and vectorText to return segments as path2 objects #1252

Closed z3dev closed 1 year ago

z3dev commented 1 year ago

These change rework both vectorChar and vectorText to convert font segments into path2 objects. This allows the font outlines to be used directly in other functions.

Actually, the results are not lists of path2 objects, but rather lists of vectorChar and vectorText objects (anonymous), and the vectorChar object has a list of path2 objects.

Some subtle bugs were corrected as well, which included the use of letterSpacing and lineSpacing.

All Submissions:

z3dev commented 1 year ago

@platypii @hrgdavor please look over these changes.

the vectorChar and vectorText functions return anonymous objects still, as there's some useful information provided about height and width. if not useful then just a list of path2 objects can be produced.

hrgdavor commented 1 year ago

useful information provided about height and width. I am for keeping that info. I am guessing it is needed to place them correctly ?

z3dev commented 1 year ago

@rozek You may be interested in these changes. If you have time then please take a look. All comments are welcome.