Skip to content

Find a faster solution for building the complement object #11

@xmacex

Description

@xmacex

This OpenSCAD program takes about 35 minutes to render on my MBA for an object of size 250. That's ridiculous.

datafile = "alpha_sweep-250-2.dat";
size = 250;

scale(0.2) {
    rotate([180, 0, 0]) {
        translate([0, -size, -size + size - 150]) {
            difference() {
                translate([0.01, 0.01, 0.01]) {
                    cube([size - 2, size - 2, size]);
                }
                surface(file = datafile, convexity = true);
                translate([0, 0, 150]) {
                    cube([size, size, size]);
                }
            }
        }
    }
}

Here's some performance measures, with the object size on x and render time in seconds on the y. I have a Notebook about it.

rendertimes

The obvious solution is of course to just flip the DataObject.surface and do the necessary minus, rotation and flipping operations in Python, and do none of these 3D operations.

PS. maybe it shouldn't be conceptualized as "the inverse", but "the complement" instead.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions