Skip to content

include() statement and external "functions" usage #7

@RustyJoeM

Description

@RustyJoeM

hello,

this is a question rather than actual issue...

Have you considered adding support for include() statement of external .scad files for resulting output scad code?

To allow adding include into resulting code, and place calls to external functions with rust-code defined parameters, where needed/appropriate - sort of new ScadElement enum type that would allow to add arbitrary included scad functions with defined (named) parameters that would contain values from rust.

e.g.:

include <BezierScad.scad>   # some public "lib" avialable for scad, with no need for us to generate innards in rust

// ... custom code generated by this crate, plus, somewhere, following:

	minkowski() {    # no problem here, ScadElement::Minkowski
		linear_extrude(1)    # no proplem again, ScadElement::LinearExtrude
		BezLine(s, width = [0.1], resolution = DETAIL_LEVEL, centered = false, showCtls = false);  # this line is scad call to included file, where values/value names are coming from rust code

Not sure if this could be implemented using some simple new ScadElement enum type with HashMap input that would allow to define function name plus param names/values or something similar...

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions