How do I get smooth curves?

kzamorkzamor Posts: 0
edited December 1969 in Hexagon Discussion

Hello,

I modeled the object in the attached picture. As you can see, there are some jaggies along the curved edges.
What I did is:

1-create a cube with tess 48
2-Create a an arc with 256 points
3-Bend the cube along the arc
4- Use smoothing level 1

I end up with 127898 tris but still a lot of jaggies.

How could I do this so that I get smooth curves everywhere?

Thanks!

«1

Comments

  • edited November 2012

    How did you end up with tris??

    No matter...there's an easier way that will give you better results with more control: Use the "sweep line" tool.

    Create the arc you want adjusting the number of points in the line to whatever pleases you. Your example uses 256 which is quite dense.

    Also using a line, create the shape you want the arc's body to assume. In your case, starting with a cube I would assume you want a "square" cross-sectional shape. In this case instead of making a square with a line tool you can use the "square" or "rectangle" maker which is also found in the "Lines" tab.

    Place the square at one end of the shape, select the "sweep line" tool under the "Surface Modeling" tab, and then click on your arc.

    The square will sweep the line using as many segments as you created the line with (in your case, that would be 256 segments).

    There's quite a few ways of fiddling with the controls, lines and cross-sectional shapes (you can use more than one and they don't all have to be the same size or shape) and playing with these variables can be quite rewarding.

    But even the simple 1-2-3 steps I just gave will probably give you far superior and more satisfying results than trying to beat a cube into submission. :-)

    snap3.jpg
    807 x 614 - 108K
    snap2.jpg
    807 x 614 - 120K
    snap1.jpg
    807 x 614 - 111K
    Post edited by emfederin_9bc0c524c8 on
  • edited November 2012

    Somebody please delete this...

    Somehow I managed to quote and re-post my previous message. :roll:

    Post edited by emfederin_9bc0c524c8 on
  • ausairausair Posts: 0
    edited December 1969

    Looks like kzamor needs a bit of twist in the swept profile. How could you do that with sweep line ?

  • edited November 2012

    ausair said:
    Looks like kzamor needs a bit of twist in the swept profile. How could you do that with sweep line ?

    Actually I took the twisting as an unintended artifact from bending, even though it doesn't look at all unattractive.

    However, if he does want the twist, the sweep control has a "taper" and a "twist" setting that can be played with.

    Here's the same 2 objectx as obove with an arbitrary "400" as a twist factor. Leaves a bit to be desired for closed loops but you can get pretty complex with open lines such as arcs.

    asdasd.jpg
    773 x 507 - 14K
    Post edited by emfederin_9bc0c524c8 on
  • ausairausair Posts: 0
    edited November 2012

    Never noticed the twist option, thats pretty cool.

    I created it with circle (couple of edges deleted) and rectangle (profile) as per afreaginname post with a twist of 20.

    Your don't really have a lot of control of the twist.

    It would be nice if you could sweep multiple profiles along the circle so you have more control of how and where you want it to twist. Maybe Hex 3 ?......Dream on.

    Curve.JPG
    266 x 398 - 17K
    Post edited by ausair on
  • edited November 2012

    ausair said:
    It would be nice if you could sweep multiple profiles along the circle so you have more control of how and where you want it to twist

    GAAK!!! In my first post I actually stated that could be done - I was wrong...I just tried it, and hex just created a separate solid for each profile all laid on top of each other. Even the "tool tip" says "a section and a profile" so there's no way around it; one profile is all we get.

    Maybe Hex 3 ?......Dream on.

    I hear DAZ is going to bundle it "real soon now" with the Brooklyn Bridge as a special offer to hexagon users... :)

    Post edited by emfederin_9bc0c524c8 on
  • ausairausair Posts: 0
    edited November 2012

    I guess the other way you could create the specific shape with the twist you want is via gordon surface. With that tool you could have multiple rectangle profiles + 4 semi circular curves to join them together (1 curve on each corner).

    or

    model using low poly box modelling approach and use 2 levels of sub'd (smoothing) possibly creasing the edges.

    Post edited by ausair on
  • kzamorkzamor Posts: 0
    edited December 1969

    Hi Guys, thanks for all the replies!

    Yes, the twisting is part of the design like in afreaginname's post. But I really want smooth edges, just like if I sculpted it in wood and then sanded it down to a 1000 grit. I don't care if it takes boatloads of memory or takes ages to render, I just want it to look smooth!

    Even at 263000 polys, it's still jagged at some places. I must be doing something wrong. Any ideas?

    At which steps should I apply the smoothing?

  • ds-mail_2e0cb9c256ds-mail_2e0cb9c256 Posts: 70
    edited December 1969

    Instead of a line along the outer edges, suggest you try chamfer along that edge

    Also try using more & smaller boxes along the extrusion length....if using a line as a guide path, use more points along the line

    Also you can do some smoothing in post by rendering larger than needed (hi res render), add a touch of blur, the reduce image to size needed....and assess from its intended use....for example as a web page display it will likely look pixelated, but a hi res render to print @ 300 ppi/dpi (not going to get into that discussion) viewed at normal distance should look great.

    Of course there are several smoothing methods/choices; some do better than others (i.e. don't just click on smoothing; look at tool box choices)

  • RoygeeRoygee Posts: 2,247
    edited December 1969

    You mean something like this?

    Used a rectangle with chamfered corners as a profile, a circle with 36 points as the sweep path. Smoothed level 1 gives 4032 polys.

    TWIST.JPG
    800 x 803 - 49K
  • kzamorkzamor Posts: 0
    edited November 2012

    In the end, I want something with the level of smoothness you see in the attached images. You see, no jaggies at the edges at all.
    Right Now, To get something close to this in smoothness, I have to render at 10000 X 10000 which isn't always possible when there is a lot of objects on screen, not enough RAM.

    Merete_Rasmussen_Yellow_Twisted_Form,_Contemporary_Applied_Arts,_London_.jpg
    1600 x 1204 - 59K
    RASMUSSEN_002.jpg
    305 x 400 - 102K
    Post edited by kzamor on
  • ausairausair Posts: 0
    edited December 1969

    I think for those shapes you would want to model a low poly cage and apply 2 or more levels of smoothing (sub'd).

  • kzamorkzamor Posts: 0
    edited December 1969

    Please forgive my ignorance, but what is a low poly cage?

  • edited November 2012

    OH NOOOOO!!!!!

    Is THIS what you're calling "jaggies"??? The ONLY way you'll get rid of them is to do a full rendering with antialiasing!

    You have to understand the medium you're playing with here. Lines and curves are built up of discrete sections that are exactly one pixel wide and high on your screen. On a quick render like you have here, the pixel is lit if more than half of the calculated point overlays that pixel and not lit if less than half. An LCD screen (say) CAN NOT SHOW half a pixel on 2 adjacent pixels. Drawing a straight computer line top to bottom on a computer screen when the top pixel is one pixel to the right of the colomn that the bottom pixel is on results in a vertical line from the top pixel straight down to the middle of the screen, and then it jumps over one pixel and draws the rest of the line straight down to the bottom pixel. This gives you a "jag" in the center of the line.

    Antialiasing fools the eye by adding shading to these pixels according to how much of the pixel would be covered if it were a true "line". The mathematical definition of a "line" is an infinite number of points lying between 2 endponts, but computer monitors don't have an infinite number of points.

    Here's a thought experiment for you: Take a bunch of square pieces of paper. Lay 2 of them out as endpoints of a line. Now take others and connect them so that there's a continuous path of squares between the starting square and the ending square with the following restriction: The squares can only touch at corners or along full edges. They can't be overlaid in anyway.

    This is how computer monitors draw lines on screens.

    PS: Your image is monochrome, and this greatly exacerbates the "jaggie" effect. Adding colors to both object and background areas aids the antialiasing engine in creating the illusion of smoothness, and this is why your other samples look smoother than your original image.

    jaggies.jpg
    862 x 599 - 65K
    Post edited by emfederin_9bc0c524c8 on
  • edited November 2012

    kzamor said:
    Please forgive my ignorance, but what is a low poly cage?

    If you have, say a square mesh that has a grid of 1000 x 1000 quads (which are 4-sided POLYgons), you end up with a mesh having a million faces. This is EXTREMELY hi density and difficult to work with. By creating the same mesh using only 10 x 10 quads, you end up with the same mesh but a lower poly count of 100 faces.

    Cages, solids, planes...all the same principle.

    Post edited by emfederin_9bc0c524c8 on
  • kzamorkzamor Posts: 0
    edited December 1969

    A-Ha! Yes afreaginname, that's it. I understand the principle, but I have no idea how to get rid of it! But I rendered this with Luxrender, at 2000X2000 and left it to cook 8 hours... eeek!
    So, do you happen to know what I should do to get that antialiasing? I use Daz Studio / Reality 2.2 / Luxrender

  • edited November 2012

    You can't get rid of it. "Smoothness" on a digital rendering is an illusion. You can only mitigate its effects, and this is where antialiasing comes in. I also added a "PS" to my previous note mentioning how color also greatly enhances the appearance of smoothness and also how monochramatic images are affected more severely by jaggies than colored images are.

    I don't know if there's a rendering engine out there that DOESN'T use antialiasing, but I've seen some where you can adjust it's aggressiveness or turn it off completely. I don't know if this feature is available in DS or the other renderers you mentioned or not.

    We need some users of these engines to chime in here... :)

    Post edited by emfederin_9bc0c524c8 on
  • edited November 2012

    kzamor said:
    ...I rendered this with Luxrender, at 2000X2000 and left it to cook 8 hours...

    This just hit me!

    2Kx2K isn't that large an image. The only way it would take 8 hours is if you had every bell and whistle the rendering progarm had to offer turned up full blast. Raytracing, shadowing, reflections and god knows what else can easily eat math processors alive!

    Henceforth you might want to render this thing with these settings turned down or off so that it renders in only a few minutes. That should give you enough image render information to let you know whether there are aesthetic flaws of some kind in the imagery.

    PS:

    Just went dox hunting... :)

    Luxrender is quite complex. Here's a link to their "render settings" page that will take you awhile to wade through, but I suspect it could help you clean up your render. Two areas that my gut tells me would help a lot are section 3 "sampler" and section 7 "filter". Also section 1 "Introduction to LuxRender's rendering process" would probably be of value.

    http://www.luxrender.net/wiki/LuxRender_Render_settings

    Post edited by emfederin_9bc0c524c8 on
  • ausairausair Posts: 0
    edited November 2012

    kzamor said:
    Please forgive my ignorance, but what is a low poly cage?

    Low poly cage and then the same cage with 2 levels of subd (smoothing)

    The low poly shape is created by extruding edges with Ctl+drag then apply 2 levels of smoothing to round it off. Where you put your low poly edges determines how smoothing affects the shape.

    Further reading and understanding of subdivision modelling here http://en.wikipedia.org/wiki/Subdivision_surface which is what I am talking about. Or here http://cg.tutsplus.com/tutorials/autodesk-3d-studio-max/an-introduction-to-subdivision-high-poly-modeling-tools-and-techniques/ Turbosmooth in max is the same as smoothing in Hex.

    HP.JPG
    427 x 291 - 21K
    LP.JPG
    431 x 263 - 20K
    Post edited by ausair on
  • kzamorkzamor Posts: 0
    edited December 1969

    Thanks for the tips guy, I will read and post my progress!

  • kzamorkzamor Posts: 0
    edited December 1969

    Roygee said:
    You mean something like this?

    Used a rectangle with chamfered corners as a profile, a circle with 36 points as the sweep path. Smoothed level 1 gives 4032 polys.

    I tried this, but ended up with a weird bump in the circle. Could you tell me how you got rid of it?

    twistedtorus.jpg
    776 x 677 - 100K
  • RoygeeRoygee Posts: 2,247
    edited December 1969

    Yeah, so did I:)

    Got rid of it with a light brushing with the soften tool - under the UV & paint tab.

    Hopefully some guru can explain to us how not to have that bump in the first place?

  • ausairausair Posts: 0
    edited December 1969

    You need to adjust the twist rotation amount until the two end profiles align (currently they do not)

  • RoygeeRoygee Posts: 2,247
    edited December 1969

    Is there a "rule of thumb" formula, or is it trial and error?

  • edited November 2012

    Roygee said:
    Is there a "rule of thumb" formula, or is it trial and error?

    It appears that the "twist" numbers refer to degrees.

    The cross-sectional shape at the start of the shape remains fixed in position and the "twist" tells how much that shape should be rotated in degrees at the end of the sweep.

    Oddly, this scheme works on a closed line (like the above circle) ONLY for one complete rotation: 360

    One complete rotation would make the starting square and the ending square mate perfectly (all the edges ending up in their original positions), and it seems to do that. But 90, 180 and 270 should also work for a square and give a twist of 1/4, 1/2 and 3/4 turns respectively.

    But they don't. :(

    Here's a circle with a square cross section with 360 applied to the twist:

    asd.JPG
    792 x 644 - 27K
    Post edited by emfederin_9bc0c524c8 on
  • edited December 1969

    Oh wow!! This "twist" algorithm is BUGGY!!! I'd give my left arm to examine the code!

    Here are 4 circles with square cross-sections, with twists of 360, 720, 1080 and 1440 applied (1,2,3 and 4 complete rotations of the square).

    I now see that even 360 has a flaw, although possibly tolerable.

    But beyond that, the flaw seems cumulative and even 720 is immediately intolerable.

    buggy!.jpg
    706 x 646 - 28K
  • RoygeeRoygee Posts: 2,247
    edited December 1969

    Thanks - now that we know it refers to degrees, it makes sense. Possibly the reason that 1/4 and 1/2 doesn't work on a square is because the square is not precisely square?

    Found that it does work well with 720 and 1080 if you harden the edges and smooth.

  • edited November 2012

    Roygee said:
    Thanks - now that we know it refers to degrees, it makes sense

    Yes, it SHOULD make sense...but I've made some oddball discoveries while playing around which seems to belie it after all. I'm starting to think that hexagon has an evil spirit intent on making me out to be a liar... :)

    Possibly the reason that 1/4 and 1/2 doesn't work on a square is because the square is not precisely square?

    No, it turns out that it's connecting the "wrong" faces. This'll take an explanation... :)

    Imagine a square as the cross section. In your mind label the edges clockwise as A,B,C and D.
    After sweeping, the end square is rotated according to the twist setting. At 360 degrees, the original square and the terminal square are both aligned A:A, B:B, C:C and D:D; exactly as if it hadn't been rotated at all.

    But at 90 degrees, the original and terminating squares are aligned A:B, B:C, C:D and D:A. At 180 degrees, they're aligned A:C, B:D, C:A and D:B.

    Now here's the problem: After the sweep, hexagon bridges the original square's edges to the terminating square's edges by connecting A-A, B-B, C-C and D-D in EVERY CASE. So the ONLY case where that comes out "evenly" is with complete 360 degree rotations; everything else has the faces stretched and twisted between the "namesake" edges instead of connecting to the edge nearest to it.

    And now about those "degrees"... 8-/

    I was playing around with high rotations and discovered that instead of using 1440, I got a really nice result using 1390! By dividing that number by 4, I got 347.5.

    Odd number, but I played further and found that either 347 or 348 achieved as nice or better result than 360 did!
    Likewise, 694/696 worked better than 720, 1941/1944 better than 1080 and of course, 1388 or 1392 works better than 1440.

    And it's still not over...

    I reasoned that "shaving" the numbers worked because of the gap between starting squares and the terminal squares. If they were touching (as they should), then 360/720/1080/1440 would work perfectly. But in my examples, I used circles with 32 points in them, so the starting squares and the terminal squares were actually a tad over 11 degrees apart. By "shaving" the twist, I was effectively UNrotating the terminal square to a position where the edges would be bridged properly.

    Following this reasoning, I made a circle using 256 points and tried the same trick. And as I suspected, the numbers I used for the 32 pt circles didn't work for the 256 pt circles because now the separation was only about 1.4 degrees. For the 256 pt circle I only had to shave them a tiny bit to achieve perfection: 1434 replaced 1440.

    And here is where I learned that the twist factor would accept decimals! Dividing 1434 by 4 gave me 358.5, which I entered into the twist instead of 360, and the 256 pt circle came out perfectly again! Likewise 717 and 1075.5 gave me perfection over 720 and 1080.

    So the problem is the algorithm used to calculate a closed loop array. The math SHOULD be calculated as though the starting square and the terminating square occupied the same position. But they don't. The terminating square is instead assumed to be located at a position APART from the origin depending on how dense the closed line is, and this space is then bridged which is a bit sloppy, IMO.

    This actually creates a problem where a closed loop array MUST be tweaked depending on both the number of points in the closed loop, as well as the shape of the cross section.

    But if you understand the problem as I laid it out (and I know it's complicated and makes for tedious reading), at least you can figure out how to tweak it.

    Here are the 256 pt circles with 358.5 | 717 | 1075.5 | 1434 degree twists

    x2.jpg
    706 x 646 - 57K
    x1.jpg
    706 x 646 - 29K
    Post edited by emfederin_9bc0c524c8 on
  • edited November 2012

    Roygee said:
    Is there a "rule of thumb" formula, or is it trial and error?

    HA!!!!!!!!!!!!!!!!!!!!! YES!!! I GOT IT!!!!!!!!!!!!!!!!!!!!!!!!!!

    After re-reading my last post, I got to thinking....

    And I came up with a formula....

    A given circle has "x" points. The default is 20, my first bunch had 32, and my last one had 256.

    On a circle, that means that each point is 360/x degrees apart. For a 20 pt circle, that's 18 degrees.

    Since the cross-sectional shapes align themselves on each point, then that is also the separation distance between the starting square and the terminal square...

    .....soooo....that distance also happens to be the number to subtract from 360 degrees to know what number to enter into the "twist" setting!

    EZ!! :)

    so that means that "T" (twist) is found this way:

    T = 360 - (360/x)

    "Ya follow me, camera guy?"

    For the default 20 pt circle, that means that T = 360 - (360/20) = 342

    For my 32 pt circles, it's 360 - (360/32) = 348.75

    And for my 256 pt circles, the actual number is 360 - (360/256) = 358.59

    So this brings us full circle now, and with this solution I can finally give a precise answer to Kzamor's query in comment #21:

    Kzamor followed Roy's lead with a 36 pt circle. So what he needs to put in as a "twist" value is:

    360 - (360/36) = 350

    Kzamor, type the number "350" into your "twist" option, and that kink will disappear completely! :)


    PS:
    Whenever you derive the twist value in this way, it represents ONE full twist. For multiple full twists, simply multiply your T value by the number of twists you want and it will also work perfectly.

    Post edited by emfederin_9bc0c524c8 on
  • de3ande3an Posts: 915
    edited December 1969

    Roygee said:
    Is there a "rule of thumb" formula, or is it trial and error?

    HA!!!!!!!!!!!!!!!!!!!!! YES!!! I GOT IT!!!!!!!!!!!!!!!!!!!!!!!!!!

    After re-reading my last post, I got to thinking....

    And I came up with a formula....


    Excellent explanation!

    This post is definately getting a bookmark.

Sign In or Register to comment.