How do remove all the duplicate coordinates from this list?
Your question is unclear for me, you can remove items from list, so in your example all items from index 16-27 would be removed.
you could also seperate xyz and remove duplicate items in the seperated list but then some index positions would be empty if you merge them together.
What is your goal.
My goal is to reduce my lines of coordinates to the absolute minimum
There are 1708 lines of X,Y,Z coordinates
But, when I break it down, I have only have 7 X coordinates, 5 Y coordinates, and 122 Z coordinates. I’d like to group each X, and Y with the appropriate Z to reduce the list of coordinates to the smallest number of lines possible.
internalize you lists x y and z i will give it a try…i guess sets are perfect to reduce evrything like you wish.
You can use specific tools, Grasshopper or Gcode specific
I’ve tried using create set with no success, what other components do I need to include in order for it to work?
just upload your internalized lists and i try to solve it.
If i try set it eliminates all duplicates.
Here you go
SET LIST.gh (38.7 KB) Any assistance is much appreciated
right klick on the curve component and klick internalise data otherwise the data container is empty
SET LIST.gh (26.4 KB)
Here’s the internalized data
there is still no data inside.
By the way there is a also this method available for curve if your system can also arcs.
SET LIST.gh (381.7 KB)
Try this one
The other thing I’m trying to do is take that list and divide it into 4 or 8 separate lists
Hi MJD,
i took a look at your file and there are some problems and solution.
The set component will not work because you eleminate already all points with similar xyz values.
Your request to delete all similar x y z values is also not working because how do dertemine what is a corner and what is not a corner by value , this will only work with direction or comparing the value with the next value and the value before.
My advice is to find the corner points by comparion the segment between the control points with the next segment, then check the angle and if its in a defined tolerance use the index to create a true false pattern.
get_only_corner.gh (364.4 KB)
What kind of seperation you want…it is unclear for me what is the goal of the list seperation.
Another thing is …do you need only polylines or can you also use arc segments…i mean a g-code understand also arcs.
@MJD What is the point of this? It seems apparent that you’re working on a 3D printing project. Are you trying to generate gcode?
The file posted by @flokart does a good job simplifying your curve. The result is 122 identical layers that each have 156 points. So the minimum data needed to recreate the simplified curve is the x,y coordinates of each of those 156 points and a list of the z-coordinates of the 122 layers (or just the starting z-coordinate, offset, and number of layers).
-Kevin
Thank you for your assistance
No, I don’t only need polylines, but how do I convert the polylines to arch segments while maintain a continuous tool path?
@kev.r ,Yes I’m generating g-code, and I would like to accomplish two things 1. reduce the code to the smallest number of lines possible. 2. be able to divide the code in 2, 4, 6 … as many segments as I’d like so if I stop my print I can do so knowing that it will start back up where its supposed to.
I would try to split the curve in segments and analyse them by type is it arc or line.
Then reduce controlpoints by compare direction from line like curve and after that join all segments.
If there is a continuous Tool Path and the path is broken into segments, how can grasshopper identify a group of segments as a curve?