cadquery icon indicating copy to clipboard operation
cadquery copied to clipboard

rework Workplane.split

Open marcus7070 opened this issue 4 years ago • 6 comments

Now also accepts Plane as an argument. Workplane split now goes through Solid.split instead of Solid.cut.

Still to do:

  • [ ] tests
  • [ ] docs

Related to #751.

marcus7070 avatar May 01 '21 01:05 marcus7070

Codecov Report

:x: Patch coverage is 78.26087% with 5 lines in your changes missing coverage. Please review. :white_check_mark: Project coverage is 94.58%. Comparing base (2b7f39b) to head (1b3a129). :warning: Report is 653 commits behind head on master.

Files with missing lines Patch % Lines
cadquery/cq.py 78.26% 3 Missing and 2 partials :warning:
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #752      +/-   ##
==========================================
- Coverage   94.64%   94.58%   -0.07%     
==========================================
  Files          32       32              
  Lines        7249     7256       +7     
  Branches      789      792       +3     
==========================================
+ Hits         6861     6863       +2     
- Misses        255      258       +3     
- Partials      133      135       +2     

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

:rocket: New features to boost your workflow:
  • :snowflake: Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

codecov[bot] avatar May 01 '21 01:05 codecov[bot]

I think I'll work on https://github.com/CadQuery/cadquery/issues/464#issuecomment-700934881 before I continue this PR. I think it makes more sense to expand the functionality of Workplane.workplane. Then we can keep the current method of splitting on a workplane instead of introducing new code to do almost the same thing (splitting on a Plane).

If there is any use case that is not covered with an improved Workplane.workplane then we can have a look at .split(Plane(...)).

marcus7070 avatar May 02 '21 00:05 marcus7070

If there is any use case that is not covered with an improved Workplane.workplane then we can have a look at .split(Plane(...)).

Such a use case is splitting with a plane specified in world coordinate system (not related to any face or other feature of the model).

fedorkotov avatar May 02 '21 14:05 fedorkotov

AFAIR the point of #464 would be to allow that too (i.e. specify origin).

adam-urbanczyk avatar May 02 '21 14:05 adam-urbanczyk

@adam-urbanczyk I thought origin was specified in local coordinate system of current face or other object because of this passage from #464 description

Just as a side note, IMHO the Workplane.workplane method is focussed around making workplanes relative to a face. I like it how it is and I don't think it should be overloaded/overcomplicated to do this job as well.

If it is specified in world coordinate system then indeed my case is covered too.

fedorkotov avatar May 02 '21 15:05 fedorkotov

How to use it please ?

lalebarde avatar Apr 23 '23 15:04 lalebarde