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

[OpenSCAD fast-cfg] MeshTools ConvexHullDecorator.py ValueError: operands could not be broadcast together #28

Open
dizcza opened this issue Sep 8, 2022 · 1 comment

Comments

@dizcza
Copy link

dizcza commented Sep 8, 2022

I'm generating an STL file out of the OpenSCAD file Helmholtz.scad (-D partnum=9) with and without fast-cfg AND fast-csg-trust-corefinement flags enabled.

I've uploaded the two versions of the same file on Dropbox.

Screenshot from 2022-09-08 20-17-01

OpenSCAD 2022.09.05.ai12123 nightly build, Linux.

With the fast-cfg enabled, Mesh -> Split Into Parts command in the MeshTools throws me the following error:

Traceback (most recent call last):
  File "cura/Scene/ConvexHullDecorator.py", line 212, in recomputeConvexHull
    hull_node = ConvexHullNode.ConvexHullNode(self._node, self.getPrintingArea(), self._raft_thickness, self._root)
  File "cura/Scene/ConvexHullDecorator.py", line 187, in getPrintingArea
    printing_area = self.getConvexHull()
  File "cura/Scene/ConvexHullDecorator.py", line 120, in getConvexHull
    return self._compute2DConvexHull()
  File "cura/Scene/ConvexHullDecorator.py", line 276, in _compute2DConvexHull
    return self._offsetHull(self._2d_convex_hull_mesh_result)
  File "cura/Scene/ConvexHullDecorator.py", line 409, in _offsetHull
    result = convex_hull.scale(scale_factor, [center.x, center.z])  # Yes, use Z instead of Y. Mixed conventions there with how the OpenGL coordinates are transmitted.
  File "UM/Math/Polygon.py", line 172, in scale
    point_data = numpy.lib.pad(self._points, ((0, 0), (0, 1)), "constant", constant_values = (1))  # Turn 3D to do an affine transformation.
  File "<__array_function__ internals>", line 5, in pad
  File "numpy/lib/arraypad.py", line 743, in pad
  File "numpy/lib/arraypad.py", line 518, in _as_pairs
  File "<__array_function__ internals>", line 5, in broadcast_to
  File "numpy/lib/stride_tricks.py", line 411, in broadcast_to
  File "numpy/lib/stride_tricks.py", line 348, in _broadcast_to
ValueError: operands could not be broadcast together with remapped shapes [original->remapped]: (2,2)  and requested shape (1,2)

Thread 0x00007f5fba7fc640 (most recent call first):
  File "/tmp/.mount_Ultima1w7bsN/share/cura/plugins/USBPrinting/USBPrinterOutputDeviceManager.py", line 88 in _updateThread
  File "threading.py", line 946 in run
  File "threading.py", line 1009 in _bootstrap_inner
  File "threading.py", line 966 in _bootstrap

Thread 0x00007f5fbb7fe640 (most recent call first):
  File "threading.py", line 324 in wait
  File "zeroconf/__init__.py", line 2534 in wait
  File "zeroconf/__init__.py", line 1715 in run
  File "threading.py", line 1009 in _bootstrap_inner
  File "threading.py", line 966 in _bootstrap

Thread 0x00007f5fbbfff640 (most recent call first):
  File "threading.py", line 324 in wait
  File "threading.py", line 600 in wait
  File "/tmp/.mount_Ultima1w7bsN/share/cura/plugins/UM3NetworkPrinting/src/Network/ZeroConfClient.py", line 81 in _handleOnServiceChangedRequests
  File "threading.py", line 946 in run
  File "threading.py", line 1009 in _bootstrap_inner
  File "threading.py", line 966 in _bootstrap

Thread 0x00007f5fc0efe640 (most recent call first):
  File "zeroconf/__init__.py", line 1369 in run
  File "threading.py", line 1009 in _bootstrap_inner
  File "threading.py", line 966 in _bootstrap

Thread 0x00007f5fc16ff640 (most recent call first):
  File "/tmp/.mount_Ultima1w7bsN/share/cura/plugins/RemovableDriveOutputDevice/RemovableDrivePlugin.py", line 61 in _updateThread
  File "threading.py", line 946 in run
  File "threading.py", line 1009 in _bootstrap_inner
  File "threading.py", line 966 in _bootstrap

Thread 0x00007f5ffa7fc640 (most recent call first):
  File "threading.py", line 320 in wait
  File "threading.py", line 460 in acquire
  File "UM/JobQueue.py", line 98 in _nextJob
  File "UM/JobQueue.py", line 124 in run
  File "threading.py", line 1009 in _bootstrap_inner
  File "threading.py", line 966 in _bootstrap

Thread 0x00007f5ffaffd640 (most recent call first):
  File "threading.py", line 320 in wait
  File "threading.py", line 460 in acquire
  File "UM/JobQueue.py", line 98 in _nextJob
  File "UM/JobQueue.py", line 124 in run
  File "threading.py", line 1009 in _bootstrap_inner
  File "threading.py", line 966 in _bootstrap

Thread 0x00007f5ffb7fe640 (most recent call first):
  File "threading.py", line 320 in wait
  File "threading.py", line 460 in acquire
  File "UM/JobQueue.py", line 98 in _nextJob
  File "UM/JobQueue.py", line 124 in run
  File "threading.py", line 1009 in _bootstrap_inner
  File "threading.py", line 966 in _bootstrap

Thread 0x00007f5ffbfff640 (most recent call first):
  File "threading.py", line 320 in wait
  File "threading.py", line 460 in acquire
  File "UM/JobQueue.py", line 98 in _nextJob
  File "UM/JobQueue.py", line 124 in run
  File "threading.py", line 1009 in _bootstrap_inner
  File "threading.py", line 966 in _bootstrap

Current thread 0x00007f6029dfa000 (most recent call first):
  File "cura/CrashHandler.py", line 397 in _logInfoWidget
  File "cura/CrashHandler.py", line 182 in _createDialog
  File "cura/CrashHandler.py", line 86 in __init__
  File "cura_app.py", line 165 in exceptHook
  File "UM/Qt/QtApplication.py", line 414 in exec
  File "cura/CuraApplication.py", line 888 in run
  File "cura_app.py", line 239 in <module>

Without the fast-cfg flag in OpenSCAD, the rendered STL file is parsed OK in the MeshTools and is split successfully.

The reason to post the issue:

  • in MeshTools: the resulting stl file looks OK and perhaps can be printed. So MeshTools should handle such cases.
  • in OpenSCAD: fast-cfg is an experimental feature
@dizcza
Copy link
Author

dizcza commented Sep 8, 2022

Let me know if I should transfer the issue to OpenSCAD github page.

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

1 participant