Attempting parametric "cropping" of multi part assy help


(Jhawkins) #1

Main goal is to take an existing assy from solidworks, which imports just fine, and make it “custom” per customer requests, which would be adjusting it to a unique length assy. The assy is a wooden furniture piece. only being modified in the x direction.

I have created a gh file that takes a source brep and generates a slicing path for splitting and rejoins the parts cropped.
It currently is set up to cut at a fractional interval for its cut location to avoid any structural parts that may interfere.
So using box dim, I am able to measure the brep, which uses maths to find difference in the req’d custom length and stock length, then based of an input variable, locates a plane at 1/n of the parts x dim, and at the (n-1)/n location; (ie 1/4 and 3/4 location) for symmetric trimming. I also have an offset calculated in this to properly create the 2 cutouts accounting for the overal difference.

alongside this I am using the origin with a z- offset to source a bunch of ‘move’ features that generate a series of points that when connected with lines, are joined into a path. The path is extruded thru 1.25 x the model depth to ensure it full captures it.
then i did a solid diff i believe to trim finally, then dispatch to sort the entities and move the correct ones using the offset and math to join to the next.

This works fine for a solid body, but not yet for a assy.
The sorting is … always different, and this looks at each part on its own, not one grouped brep… which is my goal at the moment.

main question is how can I better control when something is split the sorting of the bodies, which seem to change?
what would be a better way to define a way things could be trimmed and rejoined?
is there a better way to ‘group’ an assy to have it behave as a solid single body for this?


see attached gh file and brep file. should be clearly labeled enough to follow… let me know if you have questions.


brep test.3dm (60.6 KB)