Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Calls to OpenSCAD code imported into SolidPython can only be used as CSG objects #111

Closed
@n-e-g

Description

@n-e-g

When function is imported, especially function that renders into array, generated code is incorrect.
Example:
import file transform.scad which contain function

function translation(translation=[], x=0, y=0, z=0) = [
	[1, 0, 0, is_undef(translation[0]) ? x : translation[0])],
	[0, 1, 0, is_undef(translation[1]) ? x : translation[1])],
	[0, 0, 1, is_undef(translation[2]) ? x : translation[2])],
	[0, 0, 0, 1]
];

use transform scad:

c = cube([20, 20, 30])
t = translation(x=10, y=20, z=30)
d = multmatrix(t)(c)
print(scad_render(d))

leads to the following output:

multmatrix(m = <__main__.translation object at 0x7fbba4f22240>) {
	cube(size = [20, 20, 30]);
}

which is obviously incorrect

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions