Grasshopper

algorithmic modeling for Rhino

Hi everybody,

i am trying to split a curved surfaces with 4 breps into 5 separate segments.

however the result i am getting is that grasshopper is splitting the surface five times into 2 surfaces.

i checked previous discussions regarding that issue but without a real solution to this problem.

I would be really grateful if someone could have a look at the attached gh definition.

Thank you in advance for your help!!!!!!

Views: 4922

Attachments:

Replies to This Discussion

Like this?

Attachments:

Added a "make solid" (if D > 0) option:

This happens only: if the brep is not null, is valid, is not solid and has 1 brep face.

BTW: The thing stops (without turning red):

  • If the cutterList is empty or null or the cutters are invalid.
  • If the brep is null or is invalid.
  • If the Split Method fails for whatever reason (Note: per Split loop).
Attachments:

hi peter

thank you for helping me here!!!!!

it works really great.

I have a feeling a lot of people will be very happy about your component!!!

Actually for happiness  ... i.e. using that thing in "any situation" ... at least 1 hour (VS 10 minutes) more is required: far more checks > what happens if this (or that) is not in the menu? etc etc. Note "thicken" is tricky as well if the brep face is "curvy".

But in the Name of Science provide an "abstract" case (NOT via GH: just some Breps that you like to use as cutters [ or the planes out of these if planes can be defined and some others to split). 

keep me posted if you think ur component reaches the level of perfection ;)

In the meantime I enjoy happy times with the current state of your component.

thanks a lot again!!!!!!!!

If you have a brep List/Tree and you want to work it out against a cutter List/Tree ... this is a problem best addressed via recursion: a freaky thing that calls itself to do something until something else happens and the computer explodes (I'm so sorry, try some other time).

Imagine having as test the dollar sign (+ another S): the verticals are solids and the others [the cutters] are nurbs sheet body stuff > i.e. Brep Faces (meaning that classic bool difference etc etc won't work AND cap won't work as well). By splitting cats VS dogs and dogs VS cats you get OPEN brep pieces (per recursion) and Brep Faces that you should use to make the open things closed (join the cat with the right dog(s)).

How to "match" what to join? (Join is not that smart to do that automatically if you feed it with all the cats and all the dogs). That's the only "smart" thing on that type of stuff.

That said I have stuff that does this ... but is internal (because it does a lot of other things as well). I'll try to remove the other things and we'll see what's left (if any) for posting here.

Hi Peter,

Yes splitting DOGS VS CATS or CATS VS DOGS seems to be a problem.

Just tried to split a couple of curved surfaces with a couple of planar surfaces and it caused problems.

Of course it would cause problems.

In fact ... well ... people when they have some C# on hand they think/hope/wish that this is something from another planet capable to sort ANY onion from ANY sardine. Truth is that in 99.9999% of cases is just a couple of code lines specifically written for ...er ... a specific case (meaning that is useless for other cases). Making a Jack for all trades capable to manage ANY situation ... means quite a few hours of brain(?) storming ... and anyway this is not the way that I approach things because I have absolutely no interest to do GH "plug-in" type of stuff.

See the left vertical bar and imagine doing business with the small S: There's 2 "clash" situations occurring: the upper has meaning (where cat VS dog and dog VS cat yields a valid "split") but the lower yields an invalid solid since that "portion" of the S can't split the bar (it only just "penetrates" into the solid).

In order to fix things we need to gather information about things called BrepTrims ("indexed" Curves per BrepFace - so to speak) that (in this case anyway) are either Mated or Boundary ... or ... hmm ... Seam (but should not be any Seam in fact).

This C# for instance gets the invalid breps (per recursive split) and samples these mysterious BrepTrims in an object type of Data Tree: the main dimension is the Brep face index, the equivalent second dim 0 contains the BrepTrim curve and the other has booleans for an 1:1 "rating" of the trim based on a simple question: are you a Seam? (== bad boy)).

Thus  "reconstructing" an invalid brep is rather easy based on what that Tree tells us :

What all the above ultra freaky and.or confusing and/or off-topic things mean? Well ... I have about 20 C#  that do any imaginable Brep "opp"/query ...  but are all classified as internal > thus > as I said, one of these days I'll try to remove "some" lines of code and post something that can do a thing or two more on that matter.

WHAT an idiot: the question is: are you NOT a Seam?

thanks peter for sharing your thoughts on the cats vs dogs matter.

I am certain that people like me and jack lee and probably 99.99% of the gh beginner community would love to know how to get started with CC++. Which literature did you study?Which forums are helpful?

And this is rather more "clear"

Stopping the recursive Method and doing business with all bars (cats) but using only the big S (dogs):

Now ... using the small S (BEFORE the cavalry is called to save the queen):

etc etc

 

 ... would love to know how to get started with C#...

Hmm ... learning C# (or some other) is rather a life time goal and ... well ... although there's no limits on what you can achieve ... the stairway to heaven (or hell) is full of pain,frustration and tears. In plain English: if you are not totally committed (and willing to pay the heavy price) ... well ... what about forgetting all that freaky stuff? (the best option, trust me)

Note: 99% of beginners dream to learn programing in order to make geometry. But the truth is that this is the least (and rather the most insignificant) that you can achieve especially when working in teams with lot's of CAD/MCAD apps (and verticals) in the practice of tomorrow (bad news: tomorrow is already yesterday).

Anyway: How to go to Hell in just 123 easy steps

Step 1: get the cookies

The bible PlanA: C# In depth (Jon Skeet).
The bible PlanB: C# Step by step (John Sharp).
The bible PlanC: C# 5.0 (J/B Albahari) > my favorite

The reference: C# Language specs  ECMA-334

The candidates:

C# Fundamentals (Nakov/Kolev & Co)
C# Head First (Stellman/Greene)
C# Language (Jones)

Step 2: read the cookies (computer OFF)
Step 3: re-read the cookies (computer OFF)
...

Step 122: re-read the cookies (computer OFF)
Step 123: Open computer > burn computer > computers are a bad thing (not to mention the Skynet trivial thingy).

May The Force (the Dark Option) be with you.

 

RSS

About

Translate

Search

Photos

  • Add Photos
  • View All

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service