Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

difference() problem with extruded polygon in CGAL (F6) mode #10

Closed
Harvie opened this issue May 25, 2011 · 10 comments
Closed

difference() problem with extruded polygon in CGAL (F6) mode #10

Harvie opened this issue May 25, 2011 · 10 comments

Comments

@Harvie
Copy link

Harvie commented May 25, 2011

This renders properly with F5, but not with F6. IMHO there are no conflicting verticles, etc...

module pagoda(scale=1, height=1, ratio=2, center=true) {
    scale([scale,scale])
    linear_extrude(height=height, center=center)
    polygon(points=[[-1,1],[1,1],[1*ratio,-1],[-1*ratio,-1]], paths=[[0,1,2,3]]);
}

module male() {
    difference() {
        pagoda(ratio=2, scale=0.9);     
        translate([0,-0.21]) pagoda(ratio=2, scale=0.7, height=1.1);
    }
}

male();

Parsing design (AST generation)...
Compiling design (CSG Tree generation)...
Compilation finished.
Rendering Polygon Mesh using CGAL...
Number of vertices currently in CGAL cache: 926
Number of objects currently in CGAL cache: 99
Top level object is a 3D object:
Simple: yes
Valid: yes
Vertices: 8
Halfedges: 24
Edges: 12
Halffacets: 12
Facets: 6
Volumes: 2
Total rendering time: 0 hours, 0 minutes, 0 seconds
Rendering finished.

@Harvie
Copy link
Author

Harvie commented May 27, 2011

update: i've tried latest version and git version. actually i've got two modules (male() and female()), male() suddenly started to work, but female() doesn't and in latest git (saying: OpenSCAD 2011.05.27) it's just vice-versa (male() doesn't work again, but female() does).

module pagoda(scale=1, height=1, ratio=2, center=true) {
    scale([scale,scale])
    linear_extrude(height=height, center=center)
    polygon(points=[[-1,1],[1,1],[1*ratio,-1],[-1*ratio,-1]], paths=[[0,1,2,3]]);
}

module female() {
    difference() {
        cube([4,3,2], center=true);
        translate([0,0.6,0]) pagoda(ratio=1.5);
    }
}

module male() {
    difference() {
        pagoda(ratio=2, scale=0.9);     
        //translate([0,-0.7]) pagoda(ratio=2);
        translate([0,-0.21]) pagoda(ratio=2, scale=0.7, height=1.1);
    }
}

//female();
male();

@Harvie
Copy link
Author

Harvie commented May 27, 2011

i've restarted openscad again and both modules are working. must be some race condition or something. i don't understand...

@Harvie
Copy link
Author

Harvie commented May 27, 2011

Happend again!
Design -> Flush Caches helped me.
But i still can't intentionaly reproduce after flusing (to let you know what triggers the bug)

@tinkerology
Copy link

I'm having the same or a similar problem. Here's a simple code example that shows it. Does anyone have any ideas on how to work around the problem? Flush caches does not work for me at all.

Thanks, Scott

FRAGMENTS=40;

module drawCylinder(depth, radius)
{
// cylinder(depth, radius, radius, $fn=FRAGMENTS);
linear_extrude(height = depth, center = true, convexity = 10, twist = 0)
circle(radius, $fn=FRAGMENTS);
}

module cubeWithHoles(x,y,z)
{
difference()
{
cube([x,y,z]);

    translate([x/2,y/2,z/2])
    % drawCylinder( y * 2, x * 0.4 );

    rotate([0,90,0]) 
    translate([-1 * x/2,1 * y/2,z/2])
    % drawCylinder( y * 2, x * 0.4 );
}

}

cubeWithHoles(5,5,5);

@kintel
Copy link
Member

kintel commented Dec 12, 2011

I believe this was fixed in ad0f9f5
Could you try again with the latest version (i.e. any build of master newer than Nov 28)?

@tinkerology
Copy link

With the 12/7/2011 Windows install, I am still seeing failures with
difference with the following test:

module fails1()

{

difference() {

cube([50,50,50]);

rotate(90, [0,0,0])

% cylinder(25, 67.5, center = true);

}

}

module fails2()

{

difference() {

cube([50,50,50]);

rotate(90, [0,0,0])

%cylinder(25, 65.5, center = true);

}

}

fails1();

translate([60,0,0])

fails2();

Any ideas?

Thanks, Scott

On Mon, Dec 12, 2011 at 2:39 PM, Marius Kintel <
reply@reply.github.com

wrote:

I believe this was fixed in ad0f9f5
Could you try again with the latest version (i.e. any build of master
newer than Nov 28)?


Reply to this email directly or view it on GitHub:
#10 (comment)

@kintel
Copy link
Member

kintel commented Dec 12, 2011

It looks good here.
Could you describe in what way this fails for you, perhaps with an illustrating screenshot?

Note the difference between the % operator and the # operator: The former makes the object not take part in a CSG operation, the latter does.

@kintel
Copy link
Member

kintel commented Jan 7, 2012

Any updates on this issue?
I suspect the last report to be a misunderstanding of how the % and # operators work, but it would be nice with a confirmation so we can fix or close this issue.

@tinkerology
Copy link

Thanks! I got back to testing this weekend and everything works as
expected now. I appreciate all of your hard work on OpenSCAD!

Do you have a way to donate to the project?

Thanks again, Scott

On Mon, Dec 12, 2011 at 2:39 PM, Marius Kintel <
reply@reply.github.com

wrote:

I believe this was fixed in ad0f9f5
Could you try again with the latest version (i.e. any build of master
newer than Nov 28)?


Reply to this email directly or view it on GitHub:
#10 (comment)

@kintel
Copy link
Member

kintel commented Jan 15, 2012

Right now all we've got is a Flattr account: https://flattr.com/thing/121566/OpenSCAD-The-Programmers-Solid-3D-CAD-Modeller

@kintel kintel closed this as completed Jan 15, 2012
@donbright donbright mentioned this issue Jun 8, 2012
kevinmehall referenced this issue in SolidCode/pyscad Jul 3, 2012
@torwag torwag mentioned this issue Oct 5, 2012
t-paul pushed a commit that referenced this issue Jun 24, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants