(Part 2/3) Project 3D part to plane#2002
Conversation
97a6903 to
d975b18
Compare
|
OK, let's get this going. @antonysigma could you run our version of black in the codebase? |
d975b18 to
8de8187
Compare
Done running |
|
Still failing on black, did you use our version of the tool? |
8de8187 to
c646aee
Compare
My apologies. I mixed up |
|
OK, next step to make the CI green is to fix mypy errors. Are you up to it @antonysigma ? |
I can help resolve new |
|
There are no mypy issues on HEAD according to our CI. So I assume that everything is on your side. No need to do anything with appveyor,, you can run mypy locally and simply fix all the errors. If this sounds too complicated, we can probably help. |
Simulate the API from Build123d `project_to_viewpoint`: Given a 3D vector representing the camera position pointing at the origin `(0,0,0)`, render all visible edges/arcs/splines representing the outline of the 3D part projected to the camera. Also render all hidden edges/arcs/splines. Provide and example script `tests/test_projection.py` where a generic part (A bracket with rounded corners and a countersunk hole) is projected to top view, side view, front view, and orthogonal view, and then exported to DXF 2D drawings. Reference: https://build123d.readthedocs.io/en/latest/tech_drawing_tutorial.html
c646aee to
4552668
Compare
antonysigma
left a comment
There was a problem hiding this comment.
Hi @adam-urbanczyk ,
Yes, I need help resolving mypy errors, especially those exists before this PR.
Please refer to the inline comments for the out-of-scope errors.
-Antony
…/cadquery into antonysigma-project-to-viewpoint
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #2002 +/- ##
==========================================
+ Coverage 95.76% 95.79% +0.02%
==========================================
Files 30 30
Lines 9376 9432 +56
Branches 1395 1404 +9
==========================================
+ Hits 8979 9035 +56
Misses 242 242
Partials 155 155 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
…/cadquery into antonysigma-project-to-viewpoint
|
Thank you for doing the dirty laundry for me. It is certainly a daunting process for me to understand the legacy DXF code in the repo, not to mention patching it. I appreciate the effort. |
|
|
||
|
|
||
| def hlr( | ||
| shape, pnt: VectorLike, dir: VectorLike, focus: float | None = None, |
There was a problem hiding this comment.
I would like to provide an "up" direction with default (0, 0, 1) either in this PR or follow up. Otherwise we continue to have the problem of uncontrolled orientation.
| hlr = HLRBRep_Algo() | ||
| hlr.Add(shape.wrapped) | ||
|
|
||
| coordinate_system = gp_Ax2(Vector(pnt).toPnt(), Vector(dir).toDir()) |
Simulate the API from Build123d
project_to_viewpoint: Given a 3D vector representing the camera position pointing at the origin(0,0,0), render all visible edges/arcs/splines representing the outline of the 3D part projected to the camera.Also render all hidden edges/arcs/splines.
Provide and example script
tests/test_projection.pywhere a generic part (A bracket with rounded corners and a countersunk hole) is projected to top view, side view, front view, and orthogonal view, and then exported to DXF 2D drawings.Reference: https://build123d.readthedocs.io/en/latest/tech_drawing_tutorial.html
Expected output from
tests/test_projection.py:Follow-up of MR #2001 .
Related to: #122, #1767