Hi!
I'm trying to have each edge of a house roof to become lines (one per edge). When I use ends(unroll) and polyCut to cut at every points, I get duplicate lines.
Any way to fix that? Why would the polycut result in duplicate lines anyways…?
-Olivier
Ends -> polyCut = duplicate lines?
1965 5 1- olivierth
- Member
- 1010 posts
- Joined: April 2017
- Offline
- Konstantin Magnus
- Member
- 670 posts
- Joined: Sept. 2013
- Offline
use convertline node instead of the others.
https://procegen.konstantinmagnus.de/ [procegen.konstantinmagnus.de]
- olivierth
- Member
- 1010 posts
- Joined: April 2017
- Offline
- Konstantin Magnus
- Member
- 670 posts
- Joined: Sept. 2013
- Offline
Do you create your houses with polyexpand?
https://procegen.konstantinmagnus.de/ [procegen.konstantinmagnus.de]
- olivierth
- Member
- 1010 posts
- Joined: April 2017
- Offline
Hi Konstantin Magnus!
Very interesting example. Thanks for sharing. That “edgedist” trick is good to know!
I went with simple extrudes on boxes and booleaned the result. In my case, I wanted each roofs to be vertical at the ends and to have a 90 degrees peeks. I managed to make a wrangle that figures out what is the width axis and use that to keep the ends vertical.
// find bbox dimensions
vector max = getbbox_max(0);
vector min = getbbox_min(0);
vector dif = max-min;
// find longest axis length
float biggest = max(dif.x, dif.y, dif.z);
// find what axis is width (X, Y or Z). If 0 -> Z. If 1 -> X.
float axis = 0;
if(dif.z == biggest){
axis = 1; //error: Declaration of variable ‘axis’ shadows a previous declaration at line 11.
}
f@checkTest = axis;
// Use width value
if(axis == 0){
f@width = dif.z/2;
}
if(axis == 1){
f@width = dif.x/2;
}
…I used the resulting @width to drive the extrude distance. That way, no matter how big or small the base is, the peaks are always 90 degrees. I will also use the @width to drive the fuse “snap distance”. …and I learned that I could have simplified the “// find bbox dimensions” by using a “getbbox_size”!
If you want to see the file just tell me. I'll make a cleanup!
-Olivier
Very interesting example. Thanks for sharing. That “edgedist” trick is good to know!
I went with simple extrudes on boxes and booleaned the result. In my case, I wanted each roofs to be vertical at the ends and to have a 90 degrees peeks. I managed to make a wrangle that figures out what is the width axis and use that to keep the ends vertical.
// find bbox dimensions
vector max = getbbox_max(0);
vector min = getbbox_min(0);
vector dif = max-min;
// find longest axis length
float biggest = max(dif.x, dif.y, dif.z);
// find what axis is width (X, Y or Z). If 0 -> Z. If 1 -> X.
float axis = 0;
if(dif.z == biggest){
axis = 1; //error: Declaration of variable ‘axis’ shadows a previous declaration at line 11.
}
f@checkTest = axis;
// Use width value
if(axis == 0){
f@width = dif.z/2;
}
if(axis == 1){
f@width = dif.x/2;
}
…I used the resulting @width to drive the extrude distance. That way, no matter how big or small the base is, the peaks are always 90 degrees. I will also use the @width to drive the fuse “snap distance”. …and I learned that I could have simplified the “// find bbox dimensions” by using a “getbbox_size”!
If you want to see the file just tell me. I'll make a cleanup!
-Olivier
- Konstantin Magnus
- Member
- 670 posts
- Joined: Sept. 2013
- Offline
olivierth
If you want to see the file just tell me. I'll make a cleanup!
Oh, for me you don´t have to. But in general it´s a good idea to share files, because HIPs oftentimes explain workflows/issues much better than words or screenshots.
https://procegen.konstantinmagnus.de/ [procegen.konstantinmagnus.de]
-
- Quick Links