2D Drawing with overlapping curves, Kuka PRC

Hello there, im an architecture student and we recently recieved an assignement to create a 2d print or drawing with KUKA PRC. We do have a pretty much alreay prepared setup for the KUKA PRC Plugin but we still need to create the actual Drawing. I started with the Image Sampler. At the end i get a Mesh colors. But the 4 Inputs for the Kuka Printer are 4 Curves. Is there any way i can achive that? Any ideas are ver much appriciatet! Many thanks in advance!
Serxhio Muca

Neuer ZIP-komprimierter Ordner.zip (11.3 MB)
Here is the file.

Check out the shrink by colour examples posted by @DanielPiker

They produce curve / line outputs that would be perfect.

Shrink By Colour

Hello Marty, thanks for your reply! I sadly could not use the script as it makes a few errors. Though i managed to get a bit further with my script . I managed to turn the Image into tiny circles which with the curve component turn into cuves. Thats the component i need. The problem is that there are many circles. Is there i way i could generate a spline out of many circles, that basicly goes along each of the circles. It doesn’t have to be 1 curve it could be 4. Then i can put the 4 Curve Parameters into the Kuka.
Many Thanks!
multipen template.gh (875.5 KB)

It would help to save just the part of the grasshopper file that is creating the curves from the image otherwise people have to install all the KUKA plugins to open the file easily.

Why do this with a 6 axis robot? I’ve done similar patterns on a 3 axis CNC router… just use a V-Cutter and work out the drill depths to make each circle diameter. This is just a function of the V-Cutter angle. I created vertical lines at the centre of each circle. The longer the line, the bigger the circle diameter.

Do you want to create one or more large curves that go around each circle perimeter joining them all into one or more curve?

Can you show a sketch of what you want your curves to look like as I don’t understand what you want.

I just saved the file without the Kuka.
gdk_Withoutkuka.gh (845.0 KB)
We are doing it with this Robot because it is the only one we have at the University. And the Assignment has to be compleated with this Robot.
I want to create 1 to 4 Curves that will later define the Path of the Robot.
Many thanks! :slight_smile:

here is also a Screenshot of the actual drawing. I want to run these little Circle Curves into 1 to 4 Curves

It still doesn’t make sense to me what you want to achieve… Can you just sketch on a piece of paper and take a photo to explain.

To do this, it’s better to drill each circle.

yes something like this. Where the curve runs along the circles. As long as the Drawing remains visible any kind of curve is fine

:slight_smile: it would all have been much easier if you explained you have a KUKA with a custom tool which holds different pens, I understand from your file you have 4 different ones

I guess you aim to separate a list of circles into 4 different lists, by sampling colour maybe? in such a way you can assign each list -which correspond to circles of a given range of colors- to a particular KUKA-pen?

if yes, what colors of pen do you have available, and do you have a preference on how a given color is assigned to each pen?

on a side note, are you aware that with the current state of the last file you are going to ask the Agilus to draw 63K circles with radius ranging from 0.06mm to 0.78mm?

if you have received any guide line about the max size of your drawing and the amount of curves per color -or total number of curves- you should use, please inform because it’s relevant :slight_smile:

from what I see from your GH file with KUKA|prc components, for each tool (pen) you have offset at start and end of each curve… so why connecting all the circles together, given that each of them might be drawn as a separate entity?

1 Like

hello Inno, Thank you for your reply. :slight_smile: I would explain it if only i knew. Im sorry, I’m a compleate noob in Kuka Prc. They presentet it last time and i still am compleatly helpless with the assignment.

It seems that the 4 Pens draw 4 same circles. SO we are to use this Pattern but with our own Curves, or color maybe as you said but im not sure if it is even possible. It would be better with color but honestly just curves would be fine.

The Robot has pens with CYMK colors.

This is the Assignment:
"Utilize Grasshopper and the KR10 robot to produce an image or composition showcasing the potentials of parametric generation and robotic plotting. Explore patterns, hatching techniques, and the overlaying of diverse colors. Ensure that the paths are generated through your Grasshopper script; simple tracing of externally generated data does not meet the requirements.

I am not aware of any guidelines about the max size of the Drawing. I assume not bigger then the Table.(Refering to the Kuka Prc Table, THe file is in the Rhino-within the zip folder)

I wanted to connect the circles to also have 4 Curves like in the Sample we have, but if it can be done differently im willing to try.

Many Thanks! :slight_smile:

OK, thanks @inno for the clarification!


for each colour CMYK
create a path curve that…

Goes around a circle
Traverses to the next circle
Goes around the next circle

This is a data structure problem… Your circles are in X lists of Y circles but then you might need to split this by colour if you are going to utilise 4 pen colours.

I would start with just one pen and try and create a path that takes the first list of circles and goes around each circle and lifts, traverses and lowers to the next etc etc.

1 Like

ok, just for explaining a bit better what’s going on in the KUKA-part of the definition

horizontal rows of components 1, 2, 3, 4 are each creating a serie of KUKA commands that will make the arm move through one or more curves (and each of them corresponds to a different CMYK-color pen, each defined as a different KUKA-tool)

the A column translate your curve into planes for the KUKA to move through
the B column gives an offset to the start and end of each of your list of planes from A, meaning the KUKA will approach to the first plane at height +20, then it will go down and draw through them, then it will come back up +20 and move to the next list of planes (the first of which will also be at +20 height)
at the very end of each B group, a command is inserted at position 0 (first command to be executed) that tells the KUKA to use a specific tool for all those curves coming from the very same row of components (same color)

then you put all these commands toghether with C, and give them to D to translate them into actual code the arm can read

as it is right now, you can only process one single curve per color, but with a bit of just graft and flatten (very small effort, no additional components) you are for sure going to be able to draw multiple curves per color

like with these Flatten on Insert Item and a flatten after Merge you can use multiple curves

what the KUKA does now, I replaced the default C-color-circle with some random array of circles and plugged it to the C-color-pen-branch to show tool offset for each shape: after drawing those circles the program will continue with the remaining ones for colors M, Y, K that were already there

the following only has this “aloows for multiple curves per color” thing, nothing about how curves/colors are generated

multipen template_Re.gh (877.0 KB)


Thanks Inno thats a very good explenation. You’re a legend!! :slight_smile:
I just put in the tiny circles i have from the Image Sampler but the Programm gets overloaded.
I have to try a different approach.
Maybe you have any heads up ? :slight_smile:

well, there’s a big difference in drawing 4 circles or 63’000 ones :slight_smile:
I also believe -even if that huge amount of positions was somehow succesfully processed in GH- you’ll have a max .src file size to deal with on the KUKA side (or at least I have that on the KUKA I work with)

don’t know exactly how RGB to CMYK conversion works, I googled it and took for good the first stackoverflow solution from here: colors - How can I convert RGB to CMYK and vice versa in python? - Stack Overflow
that converst an array like [R, G, B] (each of which is in range 0-255) to an array like [C, M, Y, K] (each of which is in range 0-100, range customizable in the first lines of the code)

as your pens have color 100% C or 100% M or 100% Y or 100% K, it becomes sort of difficult to create shades of color without using some dedicated methods… one thing I guess you could try is to define shapes and hatch them with lines on different angles for different colors?

from the Python component in the file you will get the 4 separate cmyk values for each sample point you define
then I guess I would do something like “if the C/M/Y/K value of this point is >= 50 -for instance- then add the circle defined by this point to the collection of C/M/Y/K shapes to be hatched in that color”

after finding 4 lists of shapes, one list for each color, I would merge all the shapes of a given color together and then hatch the resulting final one, like this stupid example for instance?

given you have to draw each shape one by one, if you are of the idea of sampling from an image, consider that 100x100 pixels might already be a challenging task because it generates 10’000 points to deal with… which translates into 10’000 shapes the kuka should draw for you, it’s a lot :slight_smile:

a dirty and problematic prototype of the above is attached, but I warn you it uses plugins Clipper2 and the very last Elefront to handle curve booleans and hatches (probably hatches can be also handled in Rhino directly -expecially R8- but I’m still not familiar enough with new components)
the nice thing to notice is the tool -pen- change which looks like working ok between passes

as you will see, the file is not meant -and btw not ready- to be launched on the KUKA :slight_smile: but hopefully you might get some inspiration?

multipen template_Re.gh (1.9 MB)

1 Like

the method you have used is a bit complicated for me but i will try to study it and use it. :slight_smile:

So with the provided script i could just use any image to create 4 Hatches generatet by curves that may overlap. You also mentioned that the file is not ready for Kuka. I wanted to ask why?

I could not find the Plug in for the “Explode Object” Component. Do you know hich one it is?

PS: Many thanks in advance and Marry Christmas! :christmas_tree:

I think that’s a component that comes with Rhino 8, you can also use this Python, it does the same for this purpose:

if you are going to use hatches made of Lines (straight from start_point to end_point) then you can also lower this value to 2:

the Horizontal Frame component generates planes along a curve, and the KUKA will then move straight along these planes: if your curves are lines, each of them is defined by just 2 points, so you can lower the value to 2 and save some KUKA computation as intermediate planes are not necessary

an important note, hatch is the pattern inside a boundary, not comprehensive of the boundary itself:

so any contour line that you might have see in the preview would not be drawn by the KUKA (attached file is updated to preview this behavior: in case you also want to add boundary contours then the above thing of simplifying the sampling to just 2 planes per curve is not valid anymore -just to stay on the safe side, I didn’t change it from the default value of 20, but I guess you’ll have to increase it to a much higher value as hatches boundaries are pretty complex curves… anyway, one thing at a time :slight_smile: )

I have moved the drawing in the canvas in such a way there is no self-collision anymore on the robot-arm, so in theory this would work
in case the KUKA|prc component turns red it means that either some curves are too far away from the arm’s reach, or maybe there are self-collisions in the arm geometry (usually some points are too close to the arm in this case) or there are singularities
-I have a license for KUKA|prc, not sure if what I see in my screen is the very same of the free Community Version-

I have added many comments in this file: multipen template_Re_Re.gh (1.9 MB)

note also that the top of the metal plates is on XY plane with Z=1, while the sample drawings are on XY Z=0 (so also your drawing will be on XY at Z=0)

this probably means that the zero of those tools was done on the very end of the tip of each pen, and you are using that 1mm of “compenetration” between the metal plate and the tool itself as compression to make each pen push on the paper and draw (markers with retractable tip?)

in any case -and take this as a very friendly advice :heart: - if I had a KUKA arm in my university lab and I had the chance to use it… I would literally SLEEP THERE and play with it for weeks :smiley: regardless of whether robots are going to be the future or not, yours is a big opportunity that not everyone has :slight_smile: so ok to maybe get some inspiration out of this definition, but I would try the impossible with that KUKA you’re so lucky to have at your disposal!!!

Merry Christmas!


1 Like

Hey Inno, Thank you for the reply and for the very friendly advice! :slight_smile: :heart:
Ill see if i can spend some time in the lab after i succsesfully finish all the Semester assignemnts. hehe
I sadly still cannot open the script you provided since the “Define Hatch” Component doesn’t work.

Greetings! :slight_smile:

that depends on this text Panel on top left:

in Rhino click on the Option button then find Hatches:

you have to pick a name of one hatch that is installed on your Rhino and write the exact name on that text Panel

in alternative you can drag a Value List and connect it to the []P input of Hatch and it will show you all the names of the hatches you have installed, but note that even after saving the file, each time you open it you will need to re-connect the Value List to that input because on file-open it will lose its content

after connecting it will contain the name of all the hatches you have installed:

1 Like