Home Technical Talk

SmartQuad in Max2011?

polycounter lvl 17
Offline / Send Message
j_bradford polycounter lvl 17
I'm looking if there is a script (or existing feature) for max that does the Smartquad function. Here's a link to a site that illustrates what it does:

http://www.exch.demon.co.uk/jj_SmartQuad.htm

I looked around in the polyboost/graphite stuff but didn't see anything.

Thanks

Replies

  • Playdo
    Options
    Offline / Send Message
    +1 That's a very useful set of tools. Btw, no it's not in Graphite.
  • renderhjs
    Options
    Offline / Send Message
    renderhjs sublime tool
    that is crazy smart, totally like the concept :) maybe even adding some growing function where you can repeat the quad building by surface curvature approximation. +1 wanna see that in 3dsMax as script
  • elec²ron
    Options
    Offline / Send Message
    elec²ron polycounter lvl 12
    Not exactly the same but flow connect in the graphite tools can do something similar to example 2 and 6 of SmartQuad. Its in edge sub object under loops in the ribbon along side set flow and loop tools which i use all the time.

    Its a 2 click solution instead of 1 as you have to bridge the gap first then use flow connect but it works well.
  • Bryan Cavett
    Options
    Offline / Send Message
    Bryan Cavett polycounter lvl 19
    Anyone willing to tackle this script?

    It's a very useful script that I used in modo all the time.
  • renderhjs
    Options
    Offline / Send Message
    renderhjs sublime tool
    we should definitely create some script request thread, where non scripters get closer to scripters and the process of tackling that stuff.

    I would assume that SyncViewS with his illusioncatalyst scripts has a very good experience and maybe interest in touching this, will PM just in case to check this thread.
    All that normal math is not yet my turf :D but I am interested in this as well.
  • Bryan Cavett
    Options
    Offline / Send Message
    Bryan Cavett polycounter lvl 19
    Script request thread would be awesome and much needed. I would attempt this one but it is a bit out of my league as well.
  • r_fletch_r
    Options
    Offline / Send Message
    r_fletch_r polycounter lvl 9
    awesome script!
  • Mark Dygert
    Options
    Offline / Send Message
    That's pretty awesome, that would save a bunch of time! I submitted it to the 2012 beta feature request, but I think their plans are pretty set at the moment, still fingers crossed.

    I like the idea of a requests thread for scripts too or maybe just a community push to get some ideas together and see if some of them can't be created.
  • cw
    Options
    Offline / Send Message
    cw polycounter lvl 17
    I'm in, if I can do anything for requested scripts I am more than willing. I have some experience in various areas of maxscript but I'm certainly not a programmer. +1 vote for the request thread then. :)
  • Bigjohn
    Options
    Offline / Send Message
    Bigjohn polycounter lvl 11
    I've been writing maxscripts just for fun lately. If there's a thread with a good idea in it that's within my capabilities, I'll definitely make it.

    Even this script doesn't seem all that hard really, it's just that the 3D-math stuff goes a little bit over my head.
  • Bryan Cavett
    Options
    Offline / Send Message
    Bryan Cavett polycounter lvl 19
    So I've got the basic vector projection math working to get the position of the 4th point. I'm hard coding this by placing spheres at the vert postions and then generating and moving the 4th one into place with this function.

    I'll keep hammering away at this unless someone else gets it figured out.
    function QuadPoint pA pB pC =
    (
    	/*
    		Returns the 4th point position (pD) of a quad based on the existing 3 points by using vector projection. (vAB onto vAC)
    	*/
    	
    	--vAC is the vector to project on to.  It must be normalized.
    	--vAB is the vector to project.
    	--Project vAB onto vAC and then offset by the pA position (to get it in the correct world postion and not at the origin where it was projected onto the normalized vector).  This plots the point at the halfway point of where it needs to be.
    	--Add the distance of vBD to get pD where it needs to be.
    	
    	local vAC = normalize (pC-pA)
    	local vAB = pB-pA
    	local pD = (((dot vAB vAC)) * vAC + pA)
    	pD += pD-pB
    	
    	
    	return pD
    	
    )
    

    smartQuad_01.jpg
  • SyncViewS
    Options
    Offline / Send Message
    SyncViewS polycounter lvl 13
    Hi guys, I had a look at the script for XSI, but I'm not very excited. Has anyone tested it? It looks like it works in quite specific cases. I have this feeling, but is just a guess, so I can be wrong.

    Math-wise it looks similar to the IC.ExtendSurface script. Feel free to download it and have a peek at the way it calculates the border vectors to build the new geometry.

    About the "Single Quad from Edges" feature, I'd go for something simpler, even if it gives different results from Brian's method. I guess if you have two edges with different length you want to end up with a rectangular quad, not an elongated rhombus, so I think a vector addition should work:
    -- from Bryan Cavett's picture:
    -- p3Point_1 = pA
    -- p3OriginPoint = pB
    -- p3Point_2 = pC
    
    function getOppositeQuadPoint &p3Point_1 &p3OriginPoint &p3Point_2 =
    (
        local p3Vector_1 = p3Point_1 - p3OriginPoint
        local p3Vector_2 = p3Point_2 - p3OriginPoint
    
        return (p3Vector_1 + p3Vector_2 + p3OriginPoint)
    )
    

    Unfortunately I don't have much spare time. I'm spending the remaining vacation days with my family in Italy, then will go back to the UK.
  • Bryan Cavett
    Options
    Offline / Send Message
    Bryan Cavett polycounter lvl 19
    Thanks SyncViews. I now see why my original idea of using vector addition did not work. I initially wanted to use that because the dot product projection will cause skewed poly if everything is not at a right angle.
  • Bryan Cavett
    Options
    Offline / Send Message
    Bryan Cavett polycounter lvl 19
    Ok you guys can give this a try http://bryancavett.com/maxscripts/smartQuad/smartQuad.ms

    Should show up under BCTools > smartQuad

    I don't have the edge row stuff working yet so its just one poly at a time right now. You can use it on a single corner vert, 2 open edges, or you can be a little sloppy and select some interior edges just as long as you only have 2 open edges selected.

    Still some more error checking to do but you guys can give it a go. I never really used the edge row stuff in modo so I'm to concerned with making that part of the script.

    Single Vert:
    smartQuad_vert.gif

    Clean Open Edges:
    smartQuad_edge1.gif

    Sloppy Open Edges:
    smartQuad_edge2.gif
  • j_bradford
    Options
    Offline / Send Message
    j_bradford polycounter lvl 17
    Very nice!! Works great. The edge row implementation would be a welcomed addition just to automate it a little more in certain situations, but this is still great. Thank you!
  • fr0gg1e
    Options
    Offline / Send Message
    fr0gg1e polycounter lvl 17
    Modo have a nice script like this (done by Seneca Menard)
    smartQuad-StripNEW.gif
    superSmartQuad_v2.gif
  • r_fletch_r
    Options
    Offline / Send Message
    r_fletch_r polycounter lvl 9
    keep seeing Seneca's stuff, you can see why hes working at id. guys a legend.
Sign In or Register to comment.