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

Bug in Support Generation for large and complex stl parts #46

Open
Vipul-M-Rawal opened this issue Aug 21, 2024 · 1 comment
Open

Bug in Support Generation for large and complex stl parts #46

Vipul-M-Rawal opened this issue Aug 21, 2024 · 1 comment
Assignees

Comments

@Vipul-M-Rawal
Copy link

Vipul-M-Rawal commented Aug 21, 2024

Hi, I am facing issues generating block supports for the given parts. I am getting almost the same problems for many parts. To solve the issues I made some changes in the parameters also, but still the issue persists.
I am attaching the stl file and the code below:

code :
Code.txt

I am getting the given errors:

ERROR:root:Support generation failed: Input must be >= 1-d.

WARNING: Traceback (most recent call last):
File "c:\Users\vipul.k\Music\VolumeGen\Volume.py", line 98, in
supportBlockRegions = supportGenerator.identifySupportRegions(myPart, OVERHANG_ANGLE, True)
File "C:\Users\vipul.k\AppData\Roaming\Python\Python312\site-packages\pyslm\support\gridBlockSupport.py", line 1936, in identifySupportRegions
supportBlocks = super().identifySupportRegions(part, overhangAngle, findSelfIntersectingSupport)
File "C:\Users\vipul.k\AppData\Roaming\Python\Python312\site-packages\pyslm\support\support.py", line 851, in identifySupportRegions
heightMap, heightMapUpper, heightMapLower = self._identifySelfIntersectionHeightMap(subregion, offsetPoly, cutMeshUpper, bbox)
File "C:\Users\vipul.k\AppData\Roaming\Python\Python312\site-packages\pyslm\support\support.py", line 624, in _identifySelfIntersectionHeightMap
lowerImg = render.projectHeightMap(cutMesh, self.rayProjectionResolution, True, bboxCpy)
File "C:\Users\vipul.k\AppData\Roaming\Python\Python312\site-packages\pyslm\support\render.py", line 188, in projectHeightMap
c.show(visible=True)
File "C:\Users\vipul.k\AppData\Roaming\Python\Python312\site-packages\vispy\app\canvas.py", line 435, in show
self._backend._vispy_set_visible(visible)
File "C:\Users\vipul.k\AppData\Roaming\Python\Python312\site-packages\vispy\app\backends_qt.py", line 465, in _vispy_set_visible
self.showNormal()
File "C:\Users\vipul.k\AppData\Roaming\Python\Python312\site-packages\vispy\app\backends_qt.py", line 626, in event
out = super(QtBaseCanvasBackend, self).event(ev)
File "C:\Users\vipul.k\AppData\Roaming\Python\Python312\site-packages\vispy\app\backends_qt.py", line 626, in event
out = super(QtBaseCanvasBackend, self).event(ev)
File "C:\Users\vipul.k\AppData\Roaming\Python\Python312\site-packages\vispy\app\backends_qt.py", line 928, in paintGL
self._vispy_canvas.events.draw(region=None)
File "C:\Users\vipul.k\AppData\Roaming\Python\Python312\site-packages\vispy\util\event.py", line 453, in call
self._invoke_callback(cb, event)
File "C:\Users\vipul.k\AppData\Roaming\Python\Python312\site-packages\vispy\util\event.py", line 471, in _invoke_callback
_handle_exception(self.ignore_callback_errors,
<< caught exception here: >>
File "C:\Users\vipul.k\AppData\Roaming\Python\Python312\site-packages\vispy\util\event.py", line 469, in _invoke_callback
cb(event)
File "C:\Users\vipul.k\AppData\Roaming\Python\Python312\site-packages\pyslm\support\render.py", line 175, in on_draw
self.program.draw('triangles', self.filled_buf)
File "C:\Users\vipul.k\AppData\Roaming\Python\Python312\site-packages\vispy\gloo\program.py", line 543, in draw
canvas.context.flush_commands()
File "C:\Users\vipul.k\AppData\Roaming\Python\Python312\site-packages\vispy\gloo\context.py", line 172, in flush_commands
self.glir.flush(self.shared.parser)
File "C:\Users\vipul.k\AppData\Roaming\Python\Python312\site-packages\vispy\gloo\glir.py", line 584, in flush
self._shared.flush(parser)
File "C:\Users\vipul.k\AppData\Roaming\Python\Python312\site-packages\vispy\gloo\glir.py", line 506, in flush
parser.parse(self._filter(self.clear(), parser))
File "C:\Users\vipul.k\AppData\Roaming\Python\Python312\site-packages\vispy\gloo\glir.py", line 824, in parse
self._parse(command)
File "C:\Users\vipul.k\AppData\Roaming\Python\Python312\site-packages\vispy\gloo\glir.py", line 800, in _parse
ob.set_framebuffer(*args)
File "C:\Users\vipul.k\AppData\Roaming\Python\Python312\site-packages\vispy\gloo\glir.py", line 1758, in set_framebuffer
self._validate()
File "C:\Users\vipul.k\AppData\Roaming\Python\Python312\site-packages\vispy\gloo\glir.py", line 1823, in _validate
raise RuntimeError(_bad_map.get(res, 'Unknown framebuffer error: %r.'
RuntimeError: Target not equal to GL_FRAMEBUFFER
WARNING:vispy:Traceback (most recent call last):
File "c:\Users\vipul.k\Music\VolumeGen\Volume.py", line 98, in
supportBlockRegions = supportGenerator.identifySupportRegions(myPart, OVERHANG_ANGLE, True)
File "C:\Users\vipul.k\AppData\Roaming\Python\Python312\site-packages\pyslm\support\gridBlockSupport.py", line 1936, in identifySupportRegions
supportBlocks = super().identifySupportRegions(part, overhangAngle, findSelfIntersectingSupport)
File "C:\Users\vipul.k\AppData\Roaming\Python\Python312\site-packages\pyslm\support\support.py", line 851, in identifySupportRegions
heightMap, heightMapUpper, heightMapLower = self._identifySelfIntersectionHeightMap(subregion, offsetPoly, cutMeshUpper, bbox)
File "C:\Users\vipul.k\AppData\Roaming\Python\Python312\site-packages\pyslm\support\support.py", line 624, in _identifySelfIntersectionHeightMap
lowerImg = render.projectHeightMap(cutMesh, self.rayProjectionResolution, True, bboxCpy)
File "C:\Users\vipul.k\AppData\Roaming\Python\Python312\site-packages\pyslm\support\render.py", line 188, in projectHeightMap
c.show(visible=True)
File "C:\Users\vipul.k\AppData\Roaming\Python\Python312\site-packages\vispy\app\canvas.py", line 435, in show
self._backend._vispy_set_visible(visible)
File "C:\Users\vipul.k\AppData\Roaming\Python\Python312\site-packages\vispy\app\backends_qt.py", line 465, in _vispy_set_visible
self.showNormal()
File "C:\Users\vipul.k\AppData\Roaming\Python\Python312\site-packages\vispy\app\backends_qt.py", line 626, in event
out = super(QtBaseCanvasBackend, self).event(ev)
File "C:\Users\vipul.k\AppData\Roaming\Python\Python312\site-packages\vispy\app\backends_qt.py", line 626, in event
out = super(QtBaseCanvasBackend, self).event(ev)
File "C:\Users\vipul.k\AppData\Roaming\Python\Python312\site-packages\vispy\app\backends_qt.py", line 928, in paintGL
self._vispy_canvas.events.draw(region=None)
File "C:\Users\vipul.k\AppData\Roaming\Python\Python312\site-packages\vispy\util\event.py", line 453, in call
self._invoke_callback(cb, event)
File "C:\Users\vipul.k\AppData\Roaming\Python\Python312\site-packages\vispy\util\event.py", line 471, in _invoke_callback
_handle_exception(self.ignore_callback_errors,
<< caught exception here: >>
File "C:\Users\vipul.k\AppData\Roaming\Python\Python312\site-packages\vispy\util\event.py", line 469, in _invoke_callback
cb(event)
File "C:\Users\vipul.k\AppData\Roaming\Python\Python312\site-packages\pyslm\support\render.py", line 175, in on_draw
self.program.draw('triangles', self.filled_buf)
File "C:\Users\vipul.k\AppData\Roaming\Python\Python312\site-packages\vispy\gloo\program.py", line 543, in draw
canvas.context.flush_commands()
File "C:\Users\vipul.k\AppData\Roaming\Python\Python312\site-packages\vispy\gloo\context.py", line 172, in flush_commands
self.glir.flush(self.shared.parser)
File "C:\Users\vipul.k\AppData\Roaming\Python\Python312\site-packages\vispy\gloo\glir.py", line 584, in flush
self._shared.flush(parser)
File "C:\Users\vipul.k\AppData\Roaming\Python\Python312\site-packages\vispy\gloo\glir.py", line 506, in flush
parser.parse(self._filter(self.clear(), parser))
File "C:\Users\vipul.k\AppData\Roaming\Python\Python312\site-packages\vispy\gloo\glir.py", line 824, in parse
self._parse(command)
File "C:\Users\vipul.k\AppData\Roaming\Python\Python312\site-packages\vispy\gloo\glir.py", line 800, in _parse
ob.set_framebuffer(*args)
File "C:\Users\vipul.k\AppData\Roaming\Python\Python312\site-packages\vispy\gloo\glir.py", line 1758, in set_framebuffer
self._validate()
File "C:\Users\vipul.k\AppData\Roaming\Python\Python312\site-packages\vispy\gloo\glir.py", line 1823, in _validate
raise RuntimeError(_bad_map.get(res, 'Unknown framebuffer error: %r.'
RuntimeError: Target not equal to GL_FRAMEBUFFER
ERROR: Invoking <bound method Canvas.on_draw of <Canvas (PyQt5) at 0x22ccc1ee4e0>> for DrawEvent
ERROR:vispy:Invoking <bound method Canvas.on_draw of <Canvas (PyQt5) at 0x22ccc1ee4e0>> for DrawEvent

INFO:root:Time taken for support geometry creation: 46.22 seconds
C:\Users\vipul.k\AppData\Roaming\Python\Python312\site-packages\pyglet\libs\win32_init_.py:318: UserWarning: Could not set COM MTA mode. Unexpected behavior may occur.
warnings.warn("Could not set COM MTA mode. Unexpected behavior may occur.")

Structure-pack_200 mm.zip

@drlukeparry drlukeparry self-assigned this Aug 23, 2024
@drlukeparry
Copy link
Owner

drlukeparry commented Aug 23, 2024

the error appears related to the vispy module, which is using the pyglet backend, which I have observed to create some problems in the past depending on the system/platform used. Additionally, the functionality depends on having reasonably modern openGL graphics drivers that support floating-point depth framebuffers, otherwise the raytracing approach method breaks down when attempting to create supports. I imagine under certain virtualisation / cloud platforms this could be problematic.

I would suggest to install PyQt5 / PyQt6 and set the corresponding backend for vispy to use this and see if this fixes the problem you are encountering.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: No status
Development

No branches or pull requests

2 participants