Sub-divide mesh

Wondering how to accomplish a certain animation task? Ask here.

Moderators: Víctor Paredes, Belgarath, slowtiger

User avatar
Greenlaw
Posts: 10413
Joined: Mon Jun 19, 2006 5:45 pm
Location: Los Angeles
Contact:

Sub-divide mesh

Post by Greenlaw »

Hi,

I'm helping my child out on her animation project, and we created a radial mesh to use as a Smart Mesh as a test. This proof-of-concept worked better than we expected and now we'd like to increase the mesh's resolution by 4x.

So my question is...is there script, tool or technique for sub-dividing an existing mesh in Moho? I'm aware of a couple of methods for splitting paths but that's not the same thing. What we need is a way to take existing polygons and divide them at least twice.

I thought something for this already existed in Moho but I'm not seeing it now, so I might be thinking of a third party script. (Or I'm might be thinking of another program entirely because I do this in 3D modeling all all the time.)

But if this feature doesn't exist for Moho, well, it probably should, especially now that we have Quad warping. :)

Thanks in advance for any tips.
User avatar
Greenlaw
Posts: 10413
Joined: Mon Jun 19, 2006 5:45 pm
Location: Los Angeles
Contact:

Re: Sub-divide mesh

Post by Greenlaw »

One possible complication: Our mesh is mainly made of quads but because it's radial, the center-ring of polygons are actually triangles. I can easily change these center polygons to quads, but if there's a tool or technique that doesn't care about that, all the better.
User avatar
synthsin75
Posts: 10269
Joined: Mon Jan 14, 2008 11:20 pm
Location: Oklahoma
Contact:

Re: Sub-divide mesh

Post by synthsin75 »

Not helpful for maintaining quads, but my first thought was to triangulate, split curve once with everything selected, and triangulate again.
User avatar
Greenlaw
Posts: 10413
Joined: Mon Jun 19, 2006 5:45 pm
Location: Los Angeles
Contact:

Re: Sub-divide mesh

Post by Greenlaw »

Oh, that's an interesting approach. Thanks for the tip!

This might be easier than what I was thinking, which is to split the curves, connect the lines, and then use Weld Crossings to connect the lines at the intersections.

But I do wish to preserve quads if possible because I think the deformation results could be cleaner than what we get with quads.

I'll try a few things, including your suggestion, and follow up with what I learn.
User avatar
Greenlaw
Posts: 10413
Joined: Mon Jun 19, 2006 5:45 pm
Location: Los Angeles
Contact:

Re: Sub-divide mesh

Post by Greenlaw »

I was also wondering if there was a way to get the curves out of Moho and into a 3D program. Sub-dividing geometry is a trivial process there. Maybe I can do this using Moho's FBX export, and then save my sub-divided result from the 3D program as SVG for Moho.

All said and done, it might be easier to just redraw the darn thing in Moho. :D

But a script that properly subdivides polygons in Moho would be handy. I think I'll put in a request tonight.
Last edited by Greenlaw on Wed Jun 30, 2021 11:57 pm, edited 3 times in total.
User avatar
Greenlaw
Posts: 10413
Joined: Mon Jun 19, 2006 5:45 pm
Location: Los Angeles
Contact:

Re: Sub-divide mesh

Post by Greenlaw »

Or...if I can get a Moho-compatible SVG out of my 3D program, I can just create exactly the mesh I need from there more quickly.

So many options. :D
User avatar
Greenlaw
Posts: 10413
Joined: Mon Jun 19, 2006 5:45 pm
Location: Los Angeles
Contact:

Re: Sub-divide mesh

Post by Greenlaw »

Just for kicks, I tried Moho's FBX export but unfortunately, no geometry came through. Rats.

TBH, I'm not 100% sure my 3D program exports SVG but I know it can export geometry as vector EPS, so there's hope there.

Will pick this up tonight...have to get back to work now.

Edit #1: I checked the export options in my 3D program and no SVG. It does support vector EPS though, and I think I can use Illustrator to convert that to an SVG. This is a REALLY roundabout way to do this, isn't it? We'll see how this goes tonight. :)

Edit #2: Actually, I guess Moho can import EPS. Not sure if this includes vectors in the EPS so, TBD.
Last edited by Greenlaw on Wed Jun 30, 2021 11:25 pm, edited 1 time in total.
User avatar
synthsin75
Posts: 10269
Joined: Mon Jan 14, 2008 11:20 pm
Location: Oklahoma
Contact:

Re: Sub-divide mesh

Post by synthsin75 »

If it helps any, I seem to recall the triangle deformation being improved when quads were introduced. Don't quote me on that though.
User avatar
Greenlaw
Posts: 10413
Joined: Mon Jun 19, 2006 5:45 pm
Location: Los Angeles
Contact:

Re: Sub-divide mesh

Post by Greenlaw »

Oh, good! I'll keep that in mind when I test it and see how it goes.
User avatar
Greenlaw
Posts: 10413
Joined: Mon Jun 19, 2006 5:45 pm
Location: Los Angeles
Contact:

Re: Sub-divide mesh

Post by Greenlaw »

Ok, I'm back. Most of what I'm showing below is purely academic.

Here's the original shape we created for our proof-of-concept...

Image

This mesh worked remarkably well in our test. We just need it sub-divided about two more times for our final requirements.

Next I tried the Triangulate-Split-Triangulate trick. It works but it's not quite the arrangement I expected. Very interesting though...

Image

Then I tried running Split on the curves, manually connecting the new mid-points using Add Points with Autoweld enabled, and then using Weld Crossings to weld the intersections...

Image

I also had to select the points in the new radial lines and scale them from center to make the whole structure circular shaped. This result is closer to what we have in mind, but it needs to be sub-divided at least one more time. Creating this version actually went quicker than I thought. I'll continue sub-dividing this by hand but it's a going to be tedious to go another level or two, especially if I need to do this again for some reason.

So next I turned to using my 3D program LightWave. To create the mesh, I used a Cone tool to make a flattened 'cone', which resulted in this radial mesh...

Image

I tried exporting the object as an EPS. Moho didn't know what to do with the EPS, but Adobe Illustrator read the mesh as vectors just fine. From AI, I exported an SVG, and when I imported that to Moho, I got this hilarious mess... :D

Image

So, I checked for anything unusual about the object in Illustrator and found that it was read as a compound shape. I released the compound shape, which resulted in the mesh as individual polygons. I still had problems getting the SVG to import properly, so I tried AI 8.0 format and...

Image

...here is what I got in Moho. This looked promising, but unfortunately it imported to Moho as individual unwelded polygons. There may be other issues with it too because Moho is not recognizing this as a valid Smart Mesh. Do you know if there's an easy way to weld all these points?

At this point, it's not too important to get this working because I'm already resigned to using the Split, draw and weld crossing method...it may be tedious but I know it will work.

It would be great if I could create something like this in Moho natively without so much fussing.
Last edited by Greenlaw on Thu Jul 01, 2021 3:22 am, edited 1 time in total.
User avatar
Greenlaw
Posts: 10413
Joined: Mon Jun 19, 2006 5:45 pm
Location: Los Angeles
Contact:

Re: Sub-divide mesh

Post by Greenlaw »

Hmm...I'm going try welding the points in Illustrator. After dinner. :)
User avatar
synthsin75
Posts: 10269
Joined: Mon Jan 14, 2008 11:20 pm
Location: Oklahoma
Contact:

Re: Sub-divide mesh

Post by synthsin75 »

Greenlaw wrote: Thu Jul 01, 2021 3:10 am Image
Looks like something from a Disney movie that spells something inappropriate.
User avatar
synthsin75
Posts: 10269
Joined: Mon Jan 14, 2008 11:20 pm
Location: Oklahoma
Contact:

Re: Sub-divide mesh

Post by synthsin75 »

Paul's shape tool has concentric polygons, they just aren't connected. Might be an easy addition for him.
User avatar
hayasidist
Posts: 3846
Joined: Wed Feb 16, 2011 8:12 pm
Location: Kent, England

Re: Sub-divide mesh

Post by hayasidist »

hmm... back in the day of only triangular mesh, I started work on a "split" script -- it worked up to a point - take a triangle: put a point in the middle of each side and join up those points to make 4 triangles -- it got (code-wise) messy managing "edge" conditions, so I gave up - but I could resurrect that given what I now know from the "fill mesh" work. That's a "not this side of summer" job though.
synthsin75 wrote: Thu Jul 01, 2021 5:03 am Paul's shape tool has concentric polygons, they just aren't connected. Might be an easy addition for him.
if the desire is for a "spider's web" mesh of of concentric polygons - yeah -- I'll take a look at that sooner... (and I'll push the "disable script" work to the tail end of the month...)
User avatar
Greenlaw
Posts: 10413
Joined: Mon Jun 19, 2006 5:45 pm
Location: Los Angeles
Contact:

Re: Sub-divide mesh

Post by Greenlaw »

Looks like something from a Disney movie that spells something inappropriate.
Ha! :D

Actually, I did use Paul's shape tool for one version last night. I think I still had to connect the circles by drawing the radial lines, but by then I was too tired to deal with that.

Maybe I should have picked up from there this morning, but instead I went with my first plan of splitting and connecting the original shape.

Edit: I wasn't successful with welding points in Illustrator. The command there works great when your moving/welding multiple points to a target point, but not so much for averaging/welding nearest points within a range.
Post Reply