Bug #2670 Bad boolean operations on meshes

Here's the place for discussion related to coding in FreeCAD, C++ or Python. Design, interfaces and structures.
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
Post Reply
User avatar
Kunda1
Veteran
Posts: 13434
Joined: Thu Jan 05, 2017 9:03 pm

Bug #2670 Bad boolean operations on meshes

Post by Kunda1 »

Discussion related to issue #2670:

OP writes:
Description
the boolean operations(intersect/unite/difference) on two spheres have weird results.

Steps To Reproduce
1. Open FreeCAD
2. Press the "create new document" button
3. enter the python codes:

Code: Select all

import Mesh
m1 = Mesh.createSphere(1, 50)
m1.translate(1,0,0)
m2 = Mesh.createSphere(1, 50)
m2.translate(0,0,1)
m3 = m1.intersect(m2)
Mesh.show(m3)
Additional Information
OS: Windows 7
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.17.7745 (Git)
Build type: Release
Branch: master
Hash: 79dcdfbc782e24bb34db882143af7ce8ebd237bd
Python version: 2.7.8
Qt version: 4.8.7
Coin version: 4.0.0a
OCC version: 6.8.0.oce-0.17
@NormandC replies:
NormandC wrote:Since some time (0.15.4671 I believe, maybe sooner) mesh Booleans are managed by OpenSCAD. Therefore you must install OpenSCAD. The python code will be different. It will be something like this (output from doing it through the GUI):

Code: Select all

import OpenSCADUtils
mesh = OpenSCADUtils.meshoptempfile('intersection',(App.ActiveDocument.Sphere.Mesh,App.ActiveDocument.Sphere001.Mesh))
The real bug here may be that "m3 = m1.intersect(m2)" does not produce a warning/error.
Alone you go faster. Together we go farther
Please mark thread [Solved]
Want to contribute back to FC? Checkout:
'good first issues' | Open TODOs and FIXMEs | How to Help FreeCAD | How to report Bugs
User avatar
Kunda1
Veteran
Posts: 13434
Joined: Thu Jan 05, 2017 9:03 pm

Re: Bug #2670 Bad boolean operations on meshes

Post by Kunda1 »

bump
Alone you go faster. Together we go farther
Please mark thread [Solved]
Want to contribute back to FC? Checkout:
'good first issues' | Open TODOs and FIXMEs | How to Help FreeCAD | How to report Bugs
Post Reply