[OpenSCAD] Openscad crash on Intersection()

Pasca Andrei and_pasca at yahoo.com
Wed Jan 18 12:13:30 CET 2012


I tried to do that but it's quite a complex model and I'm kind of time constrained.
Trying to do that, I discovered that changing a model variable creates or solves the issue.
 
The code I'm using looks like this:
 
color([1, 0, 0, 1])
intersection(){
top_comp(top_comp_red, top_comp_green, top_comp_blue, top_comp_alfa, board_height, collision_offset);
top_keepout(top_h_limit_red, top_h_limit_green, top_h_limit_blue, top_h_limit_alfa, board_height, top_max_height, top_draw_max, top_draw_limit);
}
 
The variable that generates the error is top_draw_max and controls an if statement found in top_keepout module. (Basically, together with top_draw_limit, controls if certain height objects are drawn or not).
 
module top_keepout(top_h_limit_red, top_h_limit_green, top_h_limit_blue, top_h_limit_alfa, board_height, top_max_height, top_draw_max, top_draw_limit){
    translate([0, 0, top_max_height + board_height + 1])
    rotate(a=[0,180,0])
    color([top_h_limit_red, top_h_limit_green, top_h_limit_blue, top_h_limit_alfa])
    union(){
        if (( top_draw_max == 1) || (top_draw_limit >= 0.10)){
            linear_extrude(height = top_max_height - 0.10 + 1)
            union(){
             polygon(points = [[... some polygon points... ]], paths = [[... some paths...]]);
            }
        }
    }
}

top_comp module looks like
 
module top_comp(top_comp_red, top_comp_green, top_comp_blue, top_comp_alfa, board_height, collision_offset){
    translate([0, 0, board_height])
    color([top_comp_red, top_comp_green, top_comp_blue, top_comp_alfa])
    union(){
        translate([-80.01, 26.66, 0])
        rotate([0, 0, 90.00])
        some_component_name(collision_offset);
    }
}
 
module some_component_name(collision_offset){
    linear_extrude(height = 1.45 + collision_offset)
    union(){
        union(){
            polygon(points = [[... again, some poly points... ]], paths = [[... some paths....]]);
        }
        if (collision_offset > 0){
            edges(....2 points coordinates..., collision_offset);
            .
            .
            .
            edges(....2 points coordinates..., collision_offset);
        }
    }
}

module edges(x1, y1, x2, y2, collision_offset){
    translate([x1, y1, 0])
    rotate([0, 0, atan2(y2 - y1, x2 - x1)])
    translate([-1 * collision_offset, -1 * collision_offset, 0])
    square([sqrt((x1 - x2)  * (x1 - x2) + (y1 - y2) * (y1 - y2)) + 2 * collision_offset, 2 * collision_offset]);
}

If I'll have some time, maybe I'll try to simplify the model but I can't promisse a thing :(.

From: Triffid Hunter <triffid.hunter at gmail.com>
To: Pasca Andrei <and_pasca at yahoo.com>; openscad at rocklinux.org 
Sent: Wednesday, January 18, 2012 11:10 AM
Subject: Re: [OpenSCAD] Openscad crash on Intersection()


On Wed, Jan 18, 2012 at 8:01 PM, Pasca Andrei <and_pasca at yahoo.com> wrote:

I'm working with a complex model and I get an intereseting crash in shared_ptr.hpp Line: 414 - Expression: px != 0 (see attached picture - I hope I can attach a picture).
>I get this crash in all of the last 3 windows releases and also in the latest snapshot.
>If you need more info (model files) please contact me directly as I'm not allowed to publish the models.

Please pare your model down to the absolute minimum code that reproduces this issue. That process should also remove the information that you're keeping private.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://rocklinux.net/pipermail/openscad/attachments/20120118/179f8545/attachment.html


More information about the OpenSCAD mailing list