Merge pull request #1821 from openscad/issue1803

#1803: Fixed regression - intersections with difference child failed to preview correctly
This commit is contained in:
Marius Kintel 2016-10-08 14:21:09 +02:00 committed by GitHub
commit 5cb40a2aee
6 changed files with 14 additions and 0 deletions

View file

@ -181,6 +181,9 @@ void CSGProducts::import(shared_ptr<CSGNode> csgnode, OpenSCADOperator type, CSG
else if (type == OPENSCAD_DIFFERENCE) {
this->currentlist = &this->currentproduct->subtractions;
}
else if (type == OPENSCAD_INTERSECTION) {
this->currentlist = &this->currentproduct->intersections;
}
this->currentlist->push_back(CSGChainObject(leaf, newflags));
} else if (shared_ptr<CSGOperation> op = dynamic_pointer_cast<CSGOperation>(csgnode)) {
assert(op->left() && op->right());

10
testdata/scad/bugs/issue1803.scad vendored Normal file
View file

@ -0,0 +1,10 @@
$fn=32;
intersection(){
difference(){
cube(size=50, center=true);
cylinder(d=30,h=80, center=true);
}
cylinder(d=65,h=80,center=true);
rotate([90,0,0]) cylinder(d=65,h=80,center=true);
}

View file

@ -1415,6 +1415,7 @@ list(APPEND BUGS_FILES ${CMAKE_SOURCE_DIR}/../testdata/scad/bugs/issue13.scad
${CMAKE_SOURCE_DIR}/../testdata/scad/bugs/issue1580-import-back-to-back2.scad
${CMAKE_SOURCE_DIR}/../testdata/scad/bugs/issue1580-zero-area-triangle.scad
${CMAKE_SOURCE_DIR}/../testdata/scad/bugs/issue1580-import-zero-area-triangle.scad
${CMAKE_SOURCE_DIR}/../testdata/scad/bugs/issue1803.scad
)
# We know that we cannot import weakly manifold files into CGAL, so to make tests easier

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.7 KiB