-
Notifications
You must be signed in to change notification settings - Fork 511
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
SolveSpace won't import 3D circles/arcs from DXF #629
Comments
As could be guessed from the screenshot above, I have started on a patch for this 5c472fd |
Your modified import function creates entities in a way that is not reproducible via the UI. I'm not sure if this is the right approach, and I would be hesitant to merge this patch. |
Can you clarify what is not reproducible via the UI? |
@johreh I think what whitequark is saying is: The output .slvs file your code is going to produce can not be created with unmodified SolveSpace using the normal construction tools. In other words, you're creating new internal structures or functions just for this capability instead of reading the file and creating SS equivalent entities. BTW, I appreciate the approach of opening the issue when you decided to work on it. This provides a place for the dialog that is about to happen to get it right. Not right - optimally useful. |
I still don't quite follow, as I don't see what could not be created using normal SolveSpace tools. The patch introduces the following changes:
All of the operations are already achievable from the UI as far as I can tell. Granted, there's also changes to createDiametric, but that was just to make the code compile for testing and needs to be figured out properly. |
@johreh I may be wrong and look forward @whitequark response. But when the file is opened with the patch, I get a single group g002-sketch-in-plane with all the entities. But some of those are not in the plane. IDK how to construct that from scratch? It's also creating a quaternion in a new way, but I'm not sure how relevant that is. I don't think that plane can be created in SS without some prior entities to define it. Also: If these things are defined as extrusions and you have the extrusion vector, why not create an actual extrusion in SolveSpace? While I think that would be great, it would also raise peoples expectations for import which may not be a good thing ;-) |
You can create, move and reorient a workplane anywhere with SS. Just switch to sketch anywhere in 3d, create a new workplane and pick any point in space for its origin. The added method of creating a quaternion is the arbitrary axis algorithm from the DXF specification. It is already in the dxfrw library, but unfortunately as a private methods so I had to rewrite it. The extrusion vector in DXF files, as far as I understand it, is not necessarily the result of an actual extrusion from a 2d sketch to a solid 3d object. I don't think it should be taken to mean anything other than the normal of the plane the entity was created in. The ezdxf library documentation does a fair job of illustrating how it works I think. |
Actually, I am certain that you could not use the extrusion vector in DXF to define a 3d-object as it only describes the direction and one point along that axis. For an extrusion you need two points to define both start and end of it. |
That creates a new group, but your code doesn't appear to. Am I missing something? |
Sketch menu -> Workplane creates a new workplane in the current group. |
Oh, I completely forgot about that feature. Then your patch looks great! Thanks for being patient with me here. |
Learn something every day. But that ends up with a sketch-in-3d no? |
This I can clarify. When you extrude a 2D sketch in SolveSpace it does these steps: If you want to set the extrusion depth that would be an additional distance constraint. It's typically done between 2 points, but it could be done internally for an import. Just food for thought. I don't know the DXF spec and I see 2 angles in there related to extrusions. I just wanted to make sure you've got the SolveSpace model of extrusion down. Those 6 steps are all implemented if you create a 2D sketch-in-plane and then do an extrude of it. |
No problem. I finally got around to complete the changes for a merge request now: #640 |
JFTR, I found that arc in linked I'll take a look on few other examples of 3D DXF, for example here are |
System information
SolveSpace version: 3.0~225f82a2
Operating system: Arch
Actual behavior
Trying to import a DXF of this exported from Fusion 360


results in
The circles and arcs are imported and show up in the request list of the group, but are not drawn and cause the solver to fail.
Expected behavior
Something like

Additional information
DXF file manifesting problem.
test1 v2.zip
The text was updated successfully, but these errors were encountered: