-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
Include "triangle" library in Python environment #20439
Comments
Could you use addConvexPolygonExtrusion from Uranium? Certainly more work than "just" using triangle via MeshTools directly, but it would be something that you can use with any version of Cura, not just a future version of Cura that includes the triangle package. |
I've been using Trimesh because I'm performing boolean operations on multiple meshes, which if there's a way to do it with MeshData objects (or an easy way to convert a MeshData to a Trimesh for said operations) I haven't dug through enough code to find it. |
Wouldn't you need Blender or the Manifold3d library for that?
The MeshTools plugins has methods that you could copy: |
According to the docs, yes. |
I think it works because you have Blender installed. |
Well Blender wasn't in my system's PATH but I uninstalled it anyway and it still worked. So does this mean my dreams of easy boolean operations in Cura are dashed, or at least locked up behind seeing if there's a way to get Trimesh to tell me if there's a backend it can use installed, and if there isn't give the user an error saying "you have to have at least one of these programs installed"? Also @fieldOfView technically I gotta ask: MeshTools is AGPL licenced. You okay with me taking code from it for something under the GPL? |
Is your feature request related to a problem?
I'm working on a plugin (I've been doing that a lot lately). I tried extruding a shapely Polygon with trimesh.creation.extrudePolygon() but that relies on using an external library (either triangle or mapbox_earcut) to convert the polygon to a translation. Here's the docstring from the trimesh code:
I would say it seems odd that it includes trimesh without including all of its dependencies, but triangle is only a soft dependency and I'm not sure it ever comes up outside of extruding a polygon, so an edge case that could easily be missed.
Describe the solution you'd like
Include the "triangle" library in the libraries that ship as part of Cura's Python environment so that it's available to trimesh
Describe alternatives you've considered
I looked at the possibility of including the code for either of those libraries however they rely on compiled C extensions, so I can't just use the straight code, and I don't know if I can even use a wheel in a plugin, but I'd need to include one for every platform, and I couldn't test macOS (don't have a Mac).
(And obviously I looked at all the primitives trimesh can create and the shape I want isn't one of them)
Affected users and/or printers
Admittedly "I'm writing a plugin" seems like an incredibly small audience however I would like to use this for a new feature in my "Calibration Shapes Reborn" plugin (currently at 22.6K downloads 😁) so not only could existing users potentially make use of it, but some people may be interested purely for this feature (it's to help test bridging capability).
Additional information & file uploads
No response
The text was updated successfully, but these errors were encountered: