Open Tommamgo opened 10 months ago
I cannot reproduce the issue on my side with the master branch Which version of pymadcad do you use ?
Thank you for the prompt response.
Unfortunately, I had already deleted the library. With the understanding that it could have been due to an incorrect version of the library, I tried again with the same code example and the library version.
This time, I didn't encounter any faulty output files.
However, this time I faced issues with different test .stl files:
Traceback (most recent call last):
File "/home/linus/PycharmProjects/madCAD/main.py", line 30, in
I used these two .stl files: files.zip
System: Date: Wed Aug 30 18:20:02 2023 CEST
OS : Linux
CPU(s) : 4
Machine : x86_64
Architecture : 64bit
Environment : Python
GPU Details : error
MathText Support : False
PIP: appdirs==1.4.4 arrex==0.5.2 blessed==1.19.1 distlib==0.3.7 flyingcircus==0.1.4.0 glcontext==2.4.0 Jinja2==3.1.2 MarkupSafe==2.1.3 moderngl==5.8.2 nose==1.3.7 numpy==1.25.2 numpy-stl==3.0.1 packaging==21.3 Pillow==10.0.0 plyfile==1.0.1 PyGLM==2.7.0 pymadcad==0.15.1 pynsist==2.8 PyQt5==5.15.9 PyQt5-Qt5==5.15.2 PyQt5-sip==12.12.2 pyserial==3.5 python-utils==3.7.0 pytk==0.0.2.1 PyWavefront==1.3.3 PyYAML==6.0.1 requests_download==0.1.2 scipy==1.11.2 setuptools-scm==6.4.2 tomli==2.0.1 typing_extensions==4.7.1 wcwidth==0.2.5 yarg==0.1.9
from madcad import *
#open
read_mesh1 = io.read("stl1.stl")
read_mesh2 = io.read("stl2.stl")
read_mesh1.mergeclose()
read_mesh2.mergeclose()
# Remove the volume of the second to the first
diff = difference(read_mesh2, read_mesh1)
# Write
io.write(diff, "mesh.stl")
Did I do something wrong in my setup?
Thank you.
This discussion should be a different issue then
I don't know exactly what is stl1.stl
and stl2.stl
in your example since your zip file only contains Basis.stl
and Gemin.stl
However that seems to be a floating point precision issue: I could avoid the problem with a slight shift of one of your meshes
difference(basis, gemein.transform(0.001*vec3(1)))
Thank you for the quick response.
I apologize for the incorrect file naming.
stl1.stl = Basis.stl stl2.stl = Gemin.stl
With your changes, I was able to compile it and achieved the desired results.
Thanks!
Happy that it worked for you ! I will keep this issue opened since the floating point precision issue is a bug that needs to be solved Thanks for reporting
Hello,
I hope you're doing well. I've come across an issue while testing the 'difference' function. During the process of subtracting an STL file from another, I observed that while the object's orientation was correctly subtracted, the polygons were not closed properly.
Code:
Result:
This should be the Result:
stl1 and stl2:
stl.zip