Home Technical Talk

Maya: matching diameter to height

polycounter lvl 6
Offline / Send Message
Josh Mount polycounter lvl 6
I'm trying to get this cylinder's diameter to match the box's height. I need the scale tool to work like it does in Rhino3d but it doesn't appear to able to do that, or at least I cant figure out how to get it to do it. I know in Maya I can just move the box's verts, snap them to the top and bottom of the cylinder and have the box meet the cylinder (and If there's no other way, then ill just try to get the diameter to as close as possible and then move the box's verts) but I would prefer the cylinder to match the box perfectly. I've come across other forms of this issue in the past, where I needed to do something similar to this, and I've never been able to figure it out. How can I accomplish this? Snapping vert/s to an edge/vert/curve radially while using a single vert as a reference. Thanks for any help.matching_diametertoheight_zps39e7ae4c.jpg

Replies

  • Noors
    Options
    Offline / Send Message
    Noors greentooth
    Just mesure the height of the box and enter that as diameter ?
    Sadly there's no such nice snapping tools in Maya/Max as in CAD softwares.
    You' ll often have to mesure thing, use rule of three... if you want to be precise.
  • passerby
    Options
    Offline / Send Message
    passerby polycounter lvl 12
    Ya measure the box and use that diameter to create the cylinder. Press control+T to quickly get the bounding box dimensions of the selected object.
  • Josh Mount
    Options
    Offline / Send Message
    Josh Mount polycounter lvl 6
    Ok, thanks guys!
  • hog345
    Options
    Offline / Send Message
    hog345 polycounter lvl 12
    I wrote this for the match purpose.
    First select points from A to D like the image attached below, then run the mel.
    I am beginner at scripting, hope it help :-)
    string $vtx_sel[]= `ls -sl`;
    string $filtered_vtx[] = `filterExpand -sm 31 $vtx_sel`;
    vector $vtx1 = `pointPosition $filtered_vtx[0]`;
    vector $vtx2 = `pointPosition $filtered_vtx[1]`;
    vector $vtx3 = `pointPosition $filtered_vtx[2]`;
    vector $vtx4 = `pointPosition $filtered_vtx[3]`;
    
    float $length1 = mag($vtx1 - $vtx2);
    float $length2 = mag($vtx3 - $vtx4);
    
    string $obj_sel[]= `ls -sl -o`;
    select $obj_sel[1];
    float $scale_1 = $length1 / $length2;
    scale -r $scale_1 $scale_1 $scale_1 ;
    
    
  • Josh Mount
    Options
    Offline / Send Message
    Josh Mount polycounter lvl 6
    Thanks hog345! I'll give it a try when I get home. Thanks so much!
Sign In or Register to comment.