1
0
Fork 0
freesewing/markdown/dev/reference/api/part/draft/en.md
2022-09-21 12:28:58 +02:00

2.2 KiB

title
The part's draft method

Each part must have a draft property that holds a method that will draft the part. In other words, this method is where the actual work happens. The method's signature is as follows:

function draft(props)

The draft method receives a single parameter, an object which you can destructure to access the following properties:

Property Description
Content constructors
Path A Path constructor to create new paths
Point A Point constructor to create new points
Snippet A Snippet constructor to create new snippets
Content containers
paths Add a Path to your part by adding it to this object
points Add a Points to your part by adding it to this object
snippets Add a Snippet to your part by adding it to this object
Access to settings
absoluteOptions Access to settings.absoluteOptions
complete Access to settings.complete
measurements Access to settings.measurements
options Access to settings.options
paperless Access to settings.paperless
sa Access to settings.sa
scale Access to settings.scale
Access to utilities
getId See the getId documentation
hide See the hide documentation
log See the logging documentation
macro See the macros documentation
setHidden See the setHidden documentation
store See the store documentation
unhide See the unhide documentation
units See the units documentation
utils See the utils documentation
Return value
part Your draft method must return this