-
Notifications
You must be signed in to change notification settings - Fork 300
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
Make CadQuery examples browsable in PartCAD #1669
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #1669 +/- ##
=======================================
Coverage 95.15% 95.15%
=======================================
Files 27 27
Lines 6485 6485
Branches 1346 1346
=======================================
Hits 6171 6171
Misses 191 191
Partials 123 123
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
@openvmp Can you provide more context on your project and how the browsing will work? |
@jmwright , PartCAD is growing to become the next gen (or the first real) open source PLM. It supports many ways to define parts and CadQuery is one of them. I want PartCAD users to have easy access to examples how to use CadQuery. I want everyone to, at least, consider switching to the code-CAD approach of defining parts. And CadQuery is one of two (OpenSCAD is the other) most important ones today as that's what published AI models understand well. That's why I want CadQuery examples to be at the fingertips of all PartCAD users. This change makes CadQuery examples browsable in the PartCAD Visual Studio Code extension and in https://partcad.org/repository (under '/pub/examples/script/cadquery'). Once the React component is released, it will become possible to host these examples anywhere on the web. I'm not sure how much the latter is valuable to you since you already made the effort to visualize examples in readthedocs and PartCAD can generate markdown but not yet reStructured. However if you want to host the examples elsewhere (and you don't want to build and maintain a CadQuery specific solution that's outside of the core value proposition of CadQuery like you did with the documentation) then you will be able to use PartCAD for that purpose too. |
Thanks for the explanation @openvmp . If the other devs are OK, let's merge this. Do you have some ideas on how to keep this updated automatically? Regarding your visualization component, I don't think it will make the cut. We are using vtk.js and it looks and navigates IMHO better than what you have. You can export assemblies as a vtkjs scenes and embed them in any webpage. Any additional thoughts @jmwright @lorenzncode ? |
@adam-urbanczyk +1 to merge |
If any of CadQuery developers wants to use the PartCAD VSCode extension (do let me know if you use other IDEs to prioritise their support) then you can keep it up to date yourself. If not, PartCAD will point at a specific revision in CadQuery and I will manually move the revision every time I update CadQuery's 'partcad.yaml'.
I completely agree with this assessment. You have a complete implementation designed for your needs. I just started building a generic solution for everyone. I will continue improving PartCAD, trying to get closer to what you have and enabling everyone else to get the same faster. Maybe it will make sense for you to use PartCAD for visualisation in the future, maybe not. Your custom solution will help everyone anyway by being a northern star for PartCAD. |
It looks OK to merge. Not directly related to this PR... Sketch is not covered in the examples dir or examples.rst. I'd like to find a way to introduce Sketch somewhere in the examples. Perhaps start with the "Polygons" doc example (Ex008 in examples dir). Show the separate Sketch rather than inline form to start with. Keep the Workplane example but introduce Sketch as an alternative. import cadquery as cq
sk1 = (
cq.Sketch()
.rect(3.0, 4.0)
.push([(0, 0.75), (0, -0.75)])
.regularPolygon(0.5, 6, 90, mode="s")
)
result = cq.Workplane("front").placeSketch(sk1).extrude(0.25) @openvmp Does your visualization show CQ Sketch objects? Also you may want to add https://github.com/CadQuery/cadquery-contrib? |
It will be supported soon: partcad/partcad#192
Thanks for the tip. Will do. |
@lorenzncode I agree. In general the examples could be "modernized" and extended. |
Thanks @openvmp ! |
Landed in partcad 0.7.12.
On it |
No description provided.