vsketch.sketch_class#
Overview#
Base class for sketch managed with the |
|
Generic parameter for |
Classes#
- class vsketch.sketch_class.SketchClass#
Base class for sketch managed with the
vsk
CLI tool.Subclass must override
draw()
andfinalize()
.Overview
# -
-
execute
(seed, finalize)class -
display
(*args, **kwargs)class Execute the sketch class and display the results using
Vsketch.display()
.draw
(vsk)abc Draws the sketch.
finalize
(vsk)abc Finalize the sketch before export.
post_finalize
(vsk, path)Called after export, optional in subclasses.
class -
set_param_set
(param_set)class -
Members
- classmethod display(*args: Any, **kwargs: Any) None #
Execute the sketch class and display the results using
Vsketch.display()
.All parameters are forwarded to
Vsketch.display()
.
- abstract draw(vsk: vsketch.vsketch.Vsketch) None #
Draws the sketch.
This function must be implemented by subclasses.
- abstract finalize(vsk: vsketch.vsketch.Vsketch) None #
Finalize the sketch before export.
This function must be implemented by subclasses.
- post_finalize(vsk: vsketch.vsketch.Vsketch, path: pathlib.Path) None #
Called after export, optional in subclasses.
Intended to allow for including post-processing on saved files.
- class vsketch.sketch_class.Param(value: _T, min_value: _T | None = None, max_value: _T | None = None, *, choices: Iterable[_T] | None = None, step: None | float | int = None, unit: str = '', decimals: int | None = None)#
Bases:
Generic
[_T
]Generic parameter for
SketchClass
.This class implements a generic parameter for
SketchClass
instances. Parameters can be interacted with in thevsk
viewer and support functionalities such as saved configuration and parameter space exploration withvsk save
.Overview
# set_value
(value)Assign a value without validation.
Assign a value to the parameter provided that the value can be validated.
Members