Hi, I’m trying to create a new Shape from 2 more simple.
I use the PGS_library with the function union :
output = PGS_ShapeBoolean.union(shape[0].getShape(), shape[1].getShape());
The new shape is created but still keep the inside lines and I just need those from the new diameter. Here’s the bad result :
Any ideas ?
1 Like
Chrisir
2
No idea.
Switch the stroke of the two initial shapes off and after union switch its stroke back on?
glv
3
Hello @matheplica,
It works here with this simple example that I conjured up:
import micycle.pgs.*;
import java.util.List;
PShape s, s1, s2;
boolean inward = true;
void setup()
{
size(400, 400);
s1 = createShape(RECT, 0, 0, 50, 50);
s2 = createShape(TRIANGLE, 0, 0, 50, 25, 35, 80);
s = new PShape();
s = PGS_ShapeBoolean.union(s1, s2);
shape(s, 100, 100);
}
void draw()
{
background(0);
shape(s1, 100, 50);
shape(s2, 250, 50);
shape(s, mouseX, mouseY);
}
Reference:
My first time using this library and can’t add more to this topic.
Can you provide a minimal example?
:)
Chrisir
4
That’s fascinating
What does it stand for psg?
Ok just a basic forget.
I need to close my path.
sh = createShape();
sh.beginShape();
sh.noStroke();
sh.fill(0);
for (int i=0; i<len; i++) sh.vertex(int(random(300)), int(random(300)));
sh.vertex(sh.getVertex(0).x, sh.getVertex(0).y);
sh.endShape(CLOSE);//here
Thanks for help
2 Likes
Thanks for your suite it’s very good good job.
Now, I try to use :
PGS_Morphology.fieldWarp()
I searching the same parameter than on your example with the leaf on the github site without sucess. Sorry but I’m lost.
micycle
9
It should take the same parameters as the example – either way the docs for that method are here.
3 Likes
Thanks, I will try to ask question less quickly !
Happy new year to everyone on the earth
1 Like