Any way to scale faces locally?

   5947   9   3
User Avatar
Member
2 posts
Joined: Jan. 2015
Offline
Let's say I have a cylinder with every 3rd face in a group. I want to scale each of those faces to make them skinnier. Anyone know how to do that? When I use a transform node on that group and scale it down, it also pushes the faces into the model and I want to avoid that.

I'm trying to get a result like this.
https://postimg.org/image/3kxpqadrj/ [postimg.org]
User Avatar
Member
670 posts
Joined: Sept. 2013
Offline
Use polyextrude, check “Transform extruded front”, leave the space at “local” and play around with scale.
https://procegen.konstantinmagnus.de/ [procegen.konstantinmagnus.de]
User Avatar
Member
2 posts
Joined: Jan. 2015
Offline
Unfortunately that creates the extra faces from extruding the faces. If it weren't for that it would work perfectly
User Avatar
Member
670 posts
Joined: Sept. 2013
Offline
Just remove the tick on “Output Side”. And play around with nodes a little more!
https://procegen.konstantinmagnus.de/ [procegen.konstantinmagnus.de]
User Avatar
Member
1755 posts
Joined: March 2014
Offline
“Playing around with nodes” is hardly ever an useful advice for any particular problem, even less so that to suggest to use an extrude op for a pure transformation need. Best advice for this new user would be to suggest filing a RFE regarding transformations. And also let him or her know what the Houdini's strengths are and that not everything in Houdini sucks like the Sub-D modeling (not even an opinion), or they might leave with the wrong impression after their first two posts, like so many others.

Ffortunately this thread made it possible for me to discover an important bug of the extrude node, which will of course - the most important thing - benefit everyone after it'll be fixed. Goes to show how bad info can sometimes turn into something useful if taken seriously.
User Avatar
Member
182 posts
Joined: April 2009
Offline
You can use the primitive sop for that. The transformations are applied locally per primitive.
Edited by blackpixel - June 27, 2017 15:05:40

Attachments:
primitive_sop2.gif (1.1 MB)

User Avatar
Member
670 posts
Joined: Sept. 2013
Offline
Your rant would be a bit more convincing if you offer a ‘good solution’ instead.

And if you really want to welcome users with “file an RFE to scale a polygon” then that´s really up to you, I guess.
https://procegen.konstantinmagnus.de/ [procegen.konstantinmagnus.de]
User Avatar
Member
1755 posts
Joined: March 2014
Offline
That's not a rant, you haven't offered a good solution (because there's none currently) and I'm not here to welcome users.

From my observations, it seems a lot of users around here are confused about what lots of (new) users are after: they're not after a solution to a problem they're confronted in a production scenario, pressed by time with clients breathing down their necks to get to the thing done by the next day.

They're assessing the capabilities of the software and to give them these “solutions” is to advertise one's utter lack of understanding about what's going on here.
Edited by anon_user_89151269 - June 27, 2017 16:18:14
User Avatar
Member
670 posts
Joined: Sept. 2013
Offline
To scale polygons locally put this code into a primitive wrangle:
float scale = chf('scale');
vector nml = prim_normal(0, @primnum, {0,0,0});
int pts[] = primpoints(0, @primnum);
foreach(int pt; pts){
    matrix m = instance(v@P, nml, scale, {0,0,0}, {0,0,0,1}, v@P);
    vector pos = point(0, 'P', pt) * m;
    setpointattrib(0, 'P', pt, pos, 'set');
} 

Also make sure to click on the little plus icon next to the VEXpression to get a slider.
Edited by Konstantin Magnus - Nov. 26, 2018 09:25:01

Attachments:
prim_scale.jpg (11.5 KB)
prim_scale.hip (232.5 KB)

https://procegen.konstantinmagnus.de/ [procegen.konstantinmagnus.de]
User Avatar
Member
670 posts
Joined: Sept. 2013
Offline
Alternatively you could also move points towards their primitive´s center:

float scale = chf('scale');
int pts[] = primpoints(0, @primnum);
foreach(int pt; pts){
    vector pos_pt = point(0, 'P', pt);
    vector dir = normalize(pos_pt - v@P);
    vector pos = pos_pt + dir * scale;
    setpointattrib(0, 'P', pt, pos, 'set');
} 

Attachments:
prim_scale_2.hip (238.5 KB)

https://procegen.konstantinmagnus.de/ [procegen.konstantinmagnus.de]
  • Quick Links