For a fabrication method (milling of glass) I need to check if curves are parallel and if the distance between them are larger than a certain distances (the used diameter of the drill bit). Curves may cross each other, but when 2 curves are too close to eahc other and parallel, this toolpaths overlaps resulting if messy and sharp edges . Hence I need to include a check on the generated designs if the curves are both parallel and too closes together
Since I couldn’t find a method with standard components or external plugins in any of the past topics, and as I probably need to iterate I tried my luck in python. I’m just starting out with python, so forgive my silly mistakes at this time
Any pointers in the right direction are much appreciated
For now I ignore curved curves (couldn’t find a method in rhinoscript syntax) and just check for parallel straight lines by checking if the cross product of curve lengths is less than specified value. How to best include a check for all curves?
Maybe this can be a good start.
Group lines by angle with x axis, then for each couple of lines, test the minimum distance.
The result is a tree with each couple of close lines as a branch.
However there are cases where there could be more than 2 lines nearby, so there is a last test with Point Groups to group them together.
In fact C# is the only path towards a proper Lambo (a classic lethal Balboni for instance) … but that’s another story.
The WIP C# is almost ready: finds 3 Clusters (one nonLinear and two Linears): is this what you want or there’s some other things to add? (Note: singles [Clusters with N ==1] are also included - but, if not required, that’s elementary to deal with).
Awesome. What you describe seems about right and i’ll give it a test with some other generated patterns. (Singles are not required, but no need to excluded it … who knows a future scenario it may come in hand)
PS: i quickly realized that as a designer me owning a Lamborghini will remain just a childhood dream. I always imagined how cool Miami Vice could be if Sonny Crockett would be driving a Countach LP5000 Quattrovalvole 1986, instead of that 1986 Ferrari Testarossa, but not let’s get offtopic
Not at all: you just need to cross the Rubicon (be on high demand, that is). That said that QV is a bit crap to drive (but stunning to look at). TS is like Las Vegas (kitsch to the max). What about some Eagle LowDrag E-Type?
Code works like a charm and speed is <200ms for 400 crv’s so actually very useful in my code. Again, super grateful for the fact that you’re spending your valuable time assisting me and sharing the code ready to use
Yikes! that’s ultra pathetic. I’ll see if is possible to post some far more advanced take (for the search part) - but don’t cross your fingers (life sucks).
That said have in mind that this “core” logic can been used - as it is - for the general (of the general) case: define a Class with suitable Properties etc, sample your things in a List of that custom Type and then pass that List to the HFC Method (change - obviously - output Types accordingly).
by some unrelated search and a freak coincidence I stumbled across a component “Clean overlapping curves” that comes close to what I was looking for. It’s from the Nautilus plugin. Maybe future users stumbling across this topic may find a solution in that one
@laurent_delrieu , maybe a suggestion for a future update, I think your component could benefit form outputting the index values, so to keep track of which curves are culled and which ones are split in 2 parts.