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

Make CadQuery examples browsable in PartCAD #1669

Merged
merged 1 commit into from
Oct 5, 2024

Conversation

openvmp
Copy link
Contributor

@openvmp openvmp commented Sep 21, 2024

No description provided.

Copy link

codecov bot commented Sep 21, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 95.15%. Comparing base (5429f61) to head (4181517).
Report is 18 commits behind head on master.

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           
Flag Coverage Δ
95.15% <ø> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@jmwright
Copy link
Member

@openvmp Can you provide more context on your project and how the browsing will work?

@openvmp
Copy link
Contributor Author

openvmp commented Sep 21, 2024

@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.

@adam-urbanczyk
Copy link
Member

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 ?

@jmwright
Copy link
Member

jmwright commented Oct 3, 2024

@adam-urbanczyk +1 to merge

@openvmp
Copy link
Contributor Author

openvmp commented Oct 3, 2024

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?

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'.

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.

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.

@lorenzncode
Copy link
Member

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?

@openvmp
Copy link
Contributor Author

openvmp commented Oct 4, 2024

Does your visualization show CQ Sketch objects?

It will be supported soon: partcad/partcad#192

Also you may want to add https://github.com/CadQuery/cadquery-contrib?

Thanks for the tip. Will do.

@adam-urbanczyk
Copy link
Member

@lorenzncode I agree. In general the examples could be "modernized" and extended.

@adam-urbanczyk adam-urbanczyk merged commit e2f9e85 into CadQuery:master Oct 5, 2024
5 checks passed
@adam-urbanczyk
Copy link
Member

Thanks @openvmp !

@openvmp openvmp deleted the examples-in-partcad branch October 11, 2024 05:32
@openvmp
Copy link
Contributor Author

openvmp commented Oct 11, 2024

Does your visualization show CQ Sketch objects?

It will be supported soon: openvmp/partcad#192

Landed in partcad 0.7.12.

Also you may want to add https://github.com/CadQuery/cadquery-contrib?

On it

@openvmp openvmp restored the examples-in-partcad branch October 11, 2024 05:57
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

Successfully merging this pull request may close these issues.

4 participants