CadQuery / CadQuery/cadquery

Clip an assembly to create a section for 2D drawing

Open
#1,930 7 comments 0 reactions 0 assignees View on GitHub
assembly
Dominant language
Python
Stars
5.8k
Forks
541
Avg merge
3d 2h
Merged PRs (30d)
5

Description

I have an assembly with more then 100 parts created from straight beams to more complex extrusion profiles. Dimensions of the assembly are 8 x 2 x 2 _meter_. I have created a special DXF export system to create drawings from that assembly. To create the views I use `HLRBRep_Algo` which works very well.

However I want to create a section to show some internals. Currently I create a new `Compound` from the assembly, take the bounding box and create a larger box to cut about 90% of the assembly away. Then I can create a view which represents the section.

Some code:
```python
side = cq.Workplane('XY').add(assy.toCompound())
bb = side.val().BoundingBox()

# based on the boundingbox create a set of points and draw a polyline and extrude
cutbox = (cq.Workplane('XY')
.polyline(pts)
.close()
.extrude(bb.zlen + 10, both=True))

# create the cut
side_section = side.cut(cutbox.val())

# the side_section can now be used to represent a section view
```

But cutting takes a lot of time, it doubles the execution time. So I'm looking for something to use clipping in combination with the `HRLBrep_Algo`. Would this be even possible with OCC? Or do I need some other method?

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.