Home Technical Talk

maxscript idea - extrude surface expand

grand marshal polycounter
Offline / Send Message
pior grand marshal polycounter
Hey all, another modeling workflow improvement I have been thinking of lately.

I find myself wanting to 'expand' the surface of polygon shells alot. By expand I mean, exactly the opposite to what a chamfer would perfom on the outer outline border.

Heres a diagram :
extrudesurfaceexpand001.jpg

If I create an outline chanfer, then push it using CSslide, it gives the correct silhouette but a mess of folded shapes obviously :
extrudesurfaceexpand002.jpg

One way I somehow manage to do it, is by using a convoluted workaround involving the shell modifier and move along normals... but it kinda sucks.
extrudesurfaceexpand003.jpg
http://vimeo.com/7831268

Is there a better way to get such results? It sounds rather easy to script considering that CSslide and Shell seem to have all the core behavior needed for it ...

Please share!

Replies

  • glynnsmith
    Offline / Send Message
    glynnsmith polycounter lvl 17
    A lot of the time, I can get away with selecting the element's faces, then use the outline tool in editPoly, with positive values.

    Failing that, I do something that's probably similar to your shell trick, but with extruding the faces that make up the border, then extruding the new faces that're now side-faced. Very messy, but you get a bit of control with the extrude dialog.

    A proper script/tool for this would very handy.
  • SyncViewS
    Offline / Send Message
    SyncViewS polycounter lvl 13
    Hi Pior, I'm trying to figure out the algorithm. It doesn't seems to be trivial. Right now the obstacle I'm facing is to find the right vector for surface extension perpendicular to the border reliably.

    The general behaviour should be something like this: select some border edges to expand. If there is no selection, expand the whole border. On first click or drag start defining the extension amount, on second click or drag shift the extended border along its normals to adjust surface "curvature" (in double quotes because surface curvature is a totally different subject, about continuity in nurbs surfaces).

    p.s.
    Have you tried latest IC.FrameIt 0.7b? Does it work as you wanted?
  • pior
    Offline / Send Message
    pior grand marshal polycounter
    Hehe Synch I was sure you would jump in :P Yes the process you describe seems to be exactly what would work the best. And I understand what you mean by 'curvature', no worries :P

    If that can be of any help, if you perform a chamfer on a border edge/outline the resulting edges all sit on that desired 'curved surface' so maybe you can get the new orientation from there (by finding the average between the newly created points of a double chamfer, or something!)
  • renderhjs
    Offline / Send Message
    renderhjs sublime tool
    I am watching you guys ;)

    I like the idea, guess similar to spline > extrude or inset in editPoly/faces. except it works on edges like shift + edges selection drag.
  • CrazyButcher
    Offline / Send Message
    CrazyButcher polycounter lvl 18
    what you would do is not just take the edge normals, but create a spline from the connected edge flow (similar to Pior's arrows) and then create curvature information. ie literally slide the new vertices on the extended spline.

    this will not prevent you from overlaps and all that, which probably means you must try to detect this and run some relaxation on it. sometimes it can help to treat it as a 2d parameterization (think U,V, similar to how nurbs work)
  • SyncViewS
    Offline / Send Message
    SyncViewS polycounter lvl 13
    Hey CrazyButcher, that's the behaviour you got with nurbs. You extend an untrimmed surface and have to define only the extension amount, but in that case you have to deal with a function to describe the surface. Alter the domain, and you get your extension without any more effort.
    In poly modeling you got only points in space, without any relation between them other than defining faces, and from faces defining edges. To preserve surface curvature is needed some sort of assumption, like surface is made of quads only, so you can jump from the extension point to some points over the surface and get the curvature angle that's preserved during extrusion.
    I guess the easier solution is to extend surface by getting direction from proximal edges of each border vertex, handling the exceptions like a vertex between two edges sitting on a perfect line, then getting the extension amount from the user, and as last step let the user shift the new border along each new vertex normal (perpendicular to new surface lip in each point) to specify the new curvature. I think some tests are required.

    Right now I'm cleaning up and finalizing IC.Shape 2.0 to be released in the next few days. I'll jump onto this as soon as possible.
  • DEElekgolo
    Offline / Send Message
    DEElekgolo interpolator
    What about this script? Its poly creep feature should be something to look into.
  • CrazyButcher
    Offline / Send Message
    CrazyButcher polycounter lvl 18
    sync, I have done similar work on poly stuff, so I am aware of what information is there, and which to synthesize on your own. While there is no nurbs-like parametrization of the surface, given assumptions (quads/tris) one can create internal splines (I mean the math here). That's what I meant with the sentence "create spline... create curvature information".
    I didnt mean someone drawing splines in max, but really deduce that info from analyzing the polys. maybe I didn't make myself clear there. anyway it's possible, and works rather fine, as many artists create relative good and smooth edge flows (I've successfully implemented similar before as plugin).

    @deelekgolo, that script works by projecting vertices on a hi-res (or any reference) surface. therefore it can "slide" vertices on it. the problem presented here is "guessing" about such a reference surface that doesn't exist.
  • pior
    Offline / Send Message
    pior grand marshal polycounter
    About the curvature problem : while my diagram suggested that the new geometry should follow a 'guessed' curvature derived from the pre-existing geometry, in practice it is completely enough to just go 'flat' past the outer edge.

    In other words : lets imagine that we perform an Extrude, or a simple Shell, on the edge of the base polygonal geometry. The resulting polygons go 'down' at a 90 degrees angles from the original surface. Now if you imagine the face normals of the newly created 'thick' edge .... they point in the correct direction wanted for the surface expand script. Then, the height/curvature of the newly created geo can be controlled with a later input in the script (or through a mere move along normals performed separately, like I did on the first connect shown in my video)

    Hope this helps!!
  • Ghostscape
    Offline / Send Message
    Ghostscape polycounter lvl 13
    I've done this with shell modifier (single segment) and then with an extrusion on the new edge faces, then selecting the edge faceloop, deleting it, and then deleting the back element.

    Still messy as fuck though.
  • CrazyButcher
    Offline / Send Message
    CrazyButcher polycounter lvl 18
    no,no pior that is way too simple, we must make it more complex ;)
  • SyncViewS
    Offline / Send Message
    SyncViewS polycounter lvl 13
    CrazyButcher, I'm sorry, I never meant to sound bad. You were clear and I'm sure you know well the subject. You actually build only the math of splines not real curves, and use it to find the position for each new vertex along each curve, according to the extension value. I've been thinking about this, and it seems quite a good method, but I don't know how to create such algorithm. Aside from math that can always be learnt, the problem is I don't know how to "sample" the surface to get points to build each spline.

    The idea is:
    - Take the border vertex.
    - Take the bisector of the angle formed by the edges along the border originating from the vertex.
    - Take the vector normal to the surface originating from the vertex.
    - Build the plane from the two vectors. It is perpendicular to the surface and intersects it.
    - Get the intersection between the plane and surface edges (?)
    - Build the spline from those points in space (?)
    - Extend the spline from border end to find the final position for surface extension (?)

    Using the intersection to build the spline avoids the assumptions of a specific type of geometry like quads only.

    This is thinking out loud, I'm not sure of any of these steps. What do you have in mind?

    ExtendSurface_01.gif

    @ Pior: If going flat is enough, I guess it can be done "quite" easily by tweaking the outline tool. Basically it should be something like: store current border vertexes positions, perform the outline, then cut the resulting surface following the position of stored ex-vertexes. Not trivial, but much easier. Again, after publishing IC.Shape, I'll be on this.
  • CrazyButcher
    Offline / Send Message
    CrazyButcher polycounter lvl 18
    I tend to overreact on stuff, so no worries Synch.

    yes the sampling is indeed tricky, but what you describe sounds well. Basically walk the edges of the connected polys and check if the edge has either point on opposite sides of the plane, then intersect. Walk along the polys of those edges that did intersect.

    or you assume quads/tris (which is what most people will work with) and pick vertices based on rules (faster). the benefit of following the natural edge flow is that you get smoother transitions into the "new surface".
  • mayaterror
    Hey, with all these complicated scripts and solutions, why has no one mentioned the Push Modifier? It does exactly what you're asking about, no hassle.
  • SyncViewS
    Offline / Send Message
    SyncViewS polycounter lvl 13
    Hi guys,
    after a little bit of tricky vector math, here is the first version of a new instrument. Get IC.ExtendSurface from IllusionCatalyst web site, under page IC.Tools. Please report any issue, as well as ideas for improvement. Enjoy!

    As usual, evaluate once and find it under Customize User Interface... Category: IllusionCatalyst Tools.
  • SerdarDesign
    @Sync: Can you add this useful script under the utilities panel of IC Shape 2.0? Both are very useful and it would be nice if you integrate extendsurface to your IC Shape script.

    Thx
  • SyncViewS
    Offline / Send Message
    SyncViewS polycounter lvl 13
    Hi Serdar, I will do that for sure when it will be a bit more mature and reasonably bugs free, right now is just the first release, and it can be improved with the help of everyone here at Polycount.
  • mLichy
    oh dude!!! That is freaking slick man :D I've been wanting something like this for a long time. *bows down
  • Joshua Stubbles
    Offline / Send Message
    Joshua Stubbles polycounter lvl 19
    Works great :)
    Only issue I have with it personally, is once you edit the angle with CTRL and release it, the movement doesn't work as I'd expect/like. It would be nice to have an option (alt+ maybe?) for it to move back along the edge constraint. It would be very handy, if you ended up extruding too much.
  • mLichy
    oooh... now I think I know what you meant josh.
  • claydough
    Offline / Send Message
    claydough polycounter lvl 10
    pior wrote: »
    About the curvature problem : while my diagram suggested that the new geometry should follow a 'guessed' curvature derived from the pre-existing geometry, in practice it is completely enough to just go 'flat' past the outer edge.

    In other words : lets imagine that we perform an Extrude, or a simple Shell, on the edge of the base polygonal geometry. The resulting polygons go 'down' at a 90 degrees angles from the original surface. Now if you imagine the face normals of the newly created 'thick' edge .... they point in the correct direction wanted for the surface expand script. Then, the height/curvature of the newly created geo can be controlled with a later input in the script (or through a mere move along normals performed separately, like I did on the first connect shown in my video)

    Hope this helps!!

    That direction still needs to be averaged by the previous neighbor's edge direction to define curve?
    not jes "normal" direction alone ( not just straight? ).
    Store that curve position for offset like u described, so new correct normal direction is stored.

    rape dis here script:
    cly_gestureSmoothing.mel ( sorry mel.. but the math should iz there )

    Gesture Smoothing reaches the limit surface by using the direction of geometry before the quadrilateral divisions. The average between the vrt being calculated for and the direction vector extents, describe gesture continuity.
  • pior
    Offline / Send Message
    pior grand marshal polycounter
    Well clay Im not sure to see the relevance of that subdivision effect here? Maybe you mean predicting a whole curve instead of a "straight" surface extrude.

    And btw if you want that "energy preserved" subdivision in Max ... it simply is the Tesselation modifier. Easy!
  • SyncViewS
    Offline / Send Message
    SyncViewS polycounter lvl 13
    Hi guys,
    right now the script set the surface extension "straight" from border, taking into account the proximal border faces. It doesn't follow surface curvature, but allow to tweak the extension slant.

    @ mLichy: Thanks man, I see if I can push this a little further.

    @ Vassago: I'm afraid I cannot understand exactly what you mean. The scripts does all its math to collect extension vectors for each selected border vertex, then create the geometry to tweak. By dragging without pressing any modifier key, it changes the extension amount. When you press CTRL and drag, extended lip just revolve around extension border, like a hinge. When you drag again, after changing the extension angle, the direction is still the one you got at the beginning, it is not recalculated, and so it doesn't appear to extend "straight" anymore. Is this the issue you're referring to? If not, could you please elaborate on this?

    @ Claydough: Thank you for your offer, but I think this is another set of problems. In a closed mesh there are different assumption that can be done, and geometry doesn't have to be guessed. The only solution I could think about, is the one I shown in a previous post, by getting the intersection of a virtual plane to the surface and then building a rail spline. Unfortunately is not that simple to code, and I'm neither sure it would lead to good results.

    @ pior: Is this solution similar to what you got in mind when posted the original idea?
  • pior
    Offline / Send Message
    pior grand marshal polycounter
    Hi! Yes, as far as I am concerned it's perfect as is! It allows for some very efficient 'shelling' of objects, REALLY quickly!

    surfaceextend.jpg

    Now if there ever was another function to add ... that would be a way to somehow load a spline path as a way to define the successive extensions, with overall length and angle user-defined just the way they are now.

    For instance one could make a cool extension and manually extract a linear spline form the resulting mesh ; then, running 'extendsurfacespline' would popup a dialog to pick the desired spline profile to work from. This would allow for easy copy/pasting of a specific extension look - somehow like the shell modifier does, but better!

    Lemme know if you are interested ; if so I'll mock it up for you in images. It might require a menu with spinners for x y z and scale, plus an option to invert the spline - which is okay since copying-pasting such a spline profile is more of a uniue operation as opposed to the regular surface expand which is more of a freeform modelling tool, best used interface-free.

    Also modifier stack structure (plugin only?) is not necessary since I believe it would be very easy to just start over again to change the extension look, if the spline pasting works.
  • SyncViewS
    Offline / Send Message
    SyncViewS polycounter lvl 13
    Hi pior, of course I'm interested in improving this script! Your idea is good, but not trivial at all to implement. As you said, I wouldn't go for a plugin as modifier, but for a "one shot" tool, which is easier to handle. Before setting anything, I'd like to think it over.

    Just to be sure you know this, you can already extend limited portions of borders too, not the whole necessarily. So if you want the same extension in two or more different positions of the same object, just make two separate selections and run the tool.

    p.s.
    Thanks for the nice screenshots! Right now I'm struggling to make some simple videos work on my web site. I hate everything related to html :/
  • SyncViewS
    Offline / Send Message
    SyncViewS polycounter lvl 13
    Hi guys,
    I just release an updated version of IC.ExtendSurface 0.2. It now handles extension slant much better, even if it is still not perfect, feels like a good improvement. As usual, get it from IllusionCatalyst web site. Please let me know how it works and report any issue. Thanks.

    @ Pior: This is not the big upgrade you asked. I think it should be a completely different tool. It looks to me much more like a 1-Sweep Rail (as is called by Rinoceros3D). A set of tools I'd like to code is about these nurbs-like tools. I think your idea fits better in that set.

    @ Vassago: I'm sorry, but I couldn't understand what you meant. Please try this updated version and tell me if is better for you. Thanks.
  • SyncViewS
    Offline / Send Message
    SyncViewS polycounter lvl 13
    Hi guys, I'm bumping this up because I'd like to know your opinions and ideas before its integration into IC.Shape. Thank you.

    Get IC.ExtendSurface 0.2.
  • Jaco
    Offline / Send Message
    Jaco polycounter lvl 17
    I've been using this a lot lately and just wanted to say, thanks! I've tried it with both max 2009 and 2010 x64, no problems so far.
  • SyncViewS
    Offline / Send Message
    SyncViewS polycounter lvl 13
    Thank you Jaco for the tests. I've found sometimes changing the slant angle is a bit slow, I'll investigate the reason, but I guess it has to do with model dimensions. Anyway, there should be a revision before integration in IC.Shape. Please let me know if you find any bug or have ideas to improve it. Thanks.
  • pior
    Offline / Send Message
    pior grand marshal polycounter
    Yup just wanted to reiterate I am now using that one A LOT, its really is extremely handy and everybody I show it too just wants it :P
  • CompanionCube
    Offline / Send Message
    CompanionCube polycounter lvl 12
    SyncViewS i love this script, and thanx to pior for the concept.

    i got one little issue though and i'm not sure whats causing or if other people are having similar problem. i'm one of those minority that uses a wacom 100% of the time in Max and alot of the time with the script i'm having an issue with "left click to start another extension". sometimes it seams to work and sometimes it doesn't. i'm not sure if its to do with the pen perssure or something else. with a mouse the left click to start another extension works fine, its just with the wacom.

    i tested in max 2010 x64 (all service packs and hotfixes) & 2011 x64 on xp64 with a wacom intuos 3 with latest drivers.

    just wondering if anyone else that uses a wacom has this issue?

    thanks for any help

    ***EDIT*** i figured out that i have the wacom perfectly still and then tap it with out moving to start another extension. maybe it would be cool to add shift or alt to extend the edge and then ctrl for changing the angle or is this a bad idea?
  • SyncViewS
    Offline / Send Message
    SyncViewS polycounter lvl 13
    I use a Wacom to model too, the problem you've found is neither your nor 3ds Max fault, I know about it. The issue is when you use a mouse and left click, the mouse doesn't move, so you got a "clean left click" and the tool works fine. When you use a stylus with a tablet, right after the nib touches the tables, if there is even a very small movement, the "left click" is read like a "start drag" and a very small surface extension is performed accordingly. With a tablet you need to be very firm while clicking to make this tool work fine. I cannot remember right now how it is coded, but I think I can add a threshold of about a couple of pixel to make the tool read better the left click from a stylus.

    I planned to revise and tweak this tool before the integration into IC.Shape.
  • pior
    Offline / Send Message
    pior grand marshal polycounter
    Hey there, yeah I think there might be ways to implement this 'cursor buffer' in max. I got the feeling that some tools in max behave that way already, for instance compared to maya. But hey I might just be biased hehe.

    The tool is super handy, I use it alot :P If you want to improve on the functionality further, there might be things to try regarding the case of an extension going 'in', eventually collapsing on itself with edges intersecting each other. Maybe in such case, make everything go to a point instead. I usually commit the tool and merge everything to center, but there might be cleaner ways to avoid that. Maybe capping the whole thing as a perfectly round Ngon, with a nice quad flow to it (to avoid ending up with a 40-branched star for instance). Like, left click/ctrl drag to make extensions, then middle-clic to smart-cap the opening...

    Anyways, fantastic tool !!
  • CompanionCube
    Offline / Send Message
    CompanionCube polycounter lvl 12
    thanx SyncViewS, look forward to future updates
  • Pedro Amorim
    Sorry to revive this old thread. But I was on ICShape website and this script along with all the others are not available anymore. Does anyone know where I can get them?

    Thanks :)
  • SsSandu_C
    Offline / Send Message
    SsSandu_C polycounter lvl 13
  • mLichy
    Yeah, I noticed it was down the other day as well, but I had his scripts backed up
  • Pedro Amorim
    SsSandu_C wrote: »
    Hey Pedro! See here.

    Not working with max 2012. i think that is why Enrico took the script from his website :/
  • cptSwing
    Offline / Send Message
    cptSwing polycounter lvl 11
    it's hit and miss for me, some scripts work (span select, base object, activewindow switch thingy) ..
  • DEElekgolo
    Offline / Send Message
    DEElekgolo interpolator
    Would be nice if I could manually set the angle in which I want the edge extrude to be at.
    Just sayan.
  • Three65
    Offline / Send Message
    Three65 polycounter lvl 6
    Does Anyone Know if this can be updated to work with 2013?
  • SyncViewS
    Offline / Send Message
    SyncViewS polycounter lvl 13
    The Extend Surface script is still working in Max 2013. Being a MaxScript and not a C++ plugin, it cannot handle a huge amount of edge borders in a single operation. If you find out it crashes Max, please run it on a subset of edges, then run it again on the other sets.

    Cheers
  • Three65
    Offline / Send Message
    Three65 polycounter lvl 6
    Thanks for the reply SyncViewS, I tried to run it on just a few edges and it's still doesn't seem to work. Perhaps I am doing something wrong :\ What I am doing is selecting the edges then going to run scrips and clicking on the IC_ExtendSurface_0_2.ms file but I am not getting no dialogue at all. Could you point me in the right direction to make this work please.
  • SyncViewS
    Offline / Send Message
    SyncViewS polycounter lvl 13
    The Extend Surface is a MacroScript, it install itself on first run, or drag and drop on 3ds Max viewports.

    Once the installation is done, you can find it in the customization menu of 3ds Max. From the main menu choose:

    Customize > Customize User Interface...

    In the dialog choose the Tab relative to the kind of action you want to define to run the Extend Surface script: Keyboard shortcut, button in a Toolbar and so on.

    In the panel find a drop down menu called Category, open it and select IllusionCatalyst Tools.

    The list Actions gets populated with the Extend Surface script. Depending on the kind of action (Tab) you chose, you can assign a Keyboard shortcut, or drag and drop the name of the script over a Toolbar to create a new button.

    Once done, close the dialog.
    Create an Editable Poly object, select a border and run the script through the shortcut or the button just made.

    The Max UI is automatically saved on close.

    For further information please visit the IllusionCatalyst website.

    Cheers
  • Three65
    Offline / Send Message
    Three65 polycounter lvl 6
    Thanks for the excellent right up SyncViewS, I found then the script under the customize interface like you said but when I pressed load it asked me to find this file "MaxStartUI.kbdx" :\
  • SyncViewS
    Offline / Send Message
    SyncViewS polycounter lvl 13
    What you are trying to load is the configuration file for the 3ds Max User Interface, and it doesn't have anything to do with the script.

    - In the Customization dialog go to the Toolbars tab.
    - Find the Category: IllusionCatalyst Tools.
    - Click on the Extend Surface action and drag it to the Main toolbar on top the viewports, it will create a button for you.
    - Close the customization dialog.

    - Create an Editable Poly object, select some border edges and press the button you've just created.
  • Three65
    Offline / Send Message
    Three65 polycounter lvl 6
    EUREKA, It works....lol! Thanks for all the help SynViewS I appreciate you taking the time to explain this to me.
  • cptSwing
    Offline / Send Message
    cptSwing polycounter lvl 11
    good to see you around syncviewS :thumbup:
Sign In or Register to comment.