25_simplifying meshes

The quotes received were higher than expected so i’ll wait until the college technicians are back as they provide a cheaper service. in the meantime i’m trying to work out how to simplify the process – which essentially means simplifying the meshes coming out of Poser.

My trial license with Magics has come to a close so i don’t have an effective BooleanUnion tool at the moment – again the solution is to make the models simpler. This doesn’t mean sacrificing detail , just getting rid of all the hidden inner meshes which contribute nothing to the sculpture and positively hinder the union.

I posted to Content Paradise the official forum for Poser about how to remove unwanted body parts and a user suggested that i look into rigging and bones for a solution. To understand this you need a basic understanding of Poser figures.

Poser Figures
A Poser figure consists of a series of 3d meshes (which are connected sets of polygons). A mesh might be a foot, or a forearm, or a chest, or an eyeball, or as small as an eyelash. The meshes fit together to make the figure – there shouldn’t be any gaps but there probably are. If the figure is clothed then the clothes replace the body mesh below, so james casual has no feet just a shoe mesh. Clothes tend to leave bigger gaps. Remember gaps aren’t important if you are rendering a 2d image which is what the majority of Poser users are doing. But if you want to create a watertight STL file then gaps are fatal. Each mesh can be displayed in any color or a texture map can be wrapped around it. There is a second part to any figure and this is the Bone Structure, these are invisible in terms of rendering but are what allows the Poser figure to move around.

each body part involved in movement has an associated Bone. Moving the bone moves the body part. The bones are connected to each other too. So every individual finger joint (30 of them) has an associated bone. Poser stores its action sequences, like walking, running, jumping, fighting etc… as bone movement sequences – which can be applied to any figure that has the appropriate bone structure. My project’s idea is to apply an action sequence and then export all the individual frames as 3d models and then BooleanUnion these to make a model to be rapid prototyped – sounds straightforward, but i am just getting to the point of establishing a fool-proof pipeline after 6 months which shows how infuriating it can be.

I put a request for help in simplifying the meshes (removing the crap i don’t need) on the Poser forum and received this reply from one of the resident Poser experts (thanks juanmanuel):

The suggested method was
1. export a figure as an OBJ file
2. in a 3d modelling program (Rhino) tidy up the figure – remove crap
3. import the tidy model – imported objects become props in Poser (that is boneless)
4. add back in the bones from the original figure
5. now the simplified figure is ready for movement and exporting

Sounds reasonable but in practise it was a bit of a nightmare (as much is in Poser). The main problem is in getting the bones into exactly the same places as before. This problem in turn is dependent on Poser’s scaling issues. briefly (and I don’t understand this in depth) Poser has its own unit conventions which are different from everyone elses – amazingly when you export a figure out of Poser and then import it back in without even changing it – it is a different size, and also in the wrong place.

This looks easy enough to put back (using scaling & transition functions) but when you go into the Bone Setup room and add in the original bones they don’t fit whatsoever – again Poser has some nasty interfaces which make your job harder and I couldn’t find a way to align the figure exactly with where it was before. This image shows a combination of the original and ‘cleaned’ figure (one red one cream). They should overlap completely but don’t – this error is down to something like the 7th decimal place and as the accuracy of the vertex positions is something like this (x y z coordinates)

-0.0729698 0.416975 -0.00470674

Even if you are only a few decimal places off the bone offset means that when you try to move the figure cracks begin to appear, which is what i’m trying to eradicate in the first place.

I’ll have another look at doing the bones by hand but this looks a messy method and if one bone of about 80 is off a little you get some strange figure mutations. So in desperation I started to look for other ways to simplify the process.

OBJ Files

Poser can import and export figures as OBJ files which is a text formatted file (which is good because it can be edited by hand). An OBJ file at its simplest is a list of vertices (x,y,z coordinates) and then a list of polygon faces which use typically 4 of the vertice faces. Each body section is split from the others with a command like usemtl Fingernail, which tells the program which texture map to use for each body part. Crucially it allows you to cut out large sections of vertices which you don’t want. So this offered part of a solution.

So for example below is an image of the Right Toe (which is the front end of the shoe for clothed figures) and the code which draws it. There is an internal surface (in green) which i want to remove (because it messes up BooleanUnions later in the pipeline), so you can hunt down the associated polygon faces in the OBJ file and comment them out (by putting a # in front of them as shown).

So the Right toe can be simplified.

Here is a list of all the usemtl parts for a single Poser figure (James Casual from Poser 6) – i’ve added the line numbers at which the line appears out of a 130,000 line OBJ file.

3742:usemtl pants
4445:usemtl Tshirt3
4824:usemtl pants
5495:usemtl Tshirt3
6740:usemtl Tshirt3
7478:usemtl Head
7525:usemtl SkinBody
7586:usemtl Head
7591:usemtl SkinBody
27252:usemtl Gums
28189:usemtl Tongue
28941:usemtl Gums
29028:usemtl Tongue
29030:usemtl Gums
29075:usemtl Tongue
29100:usemtl Gums
29123:usemtl Tongue
29136:usemtl TeethBottom
29650:usemtl TeethTop
30261:usemtl TopEyelashes
30310:usemtl BottomEyelashes
30359:usemtl TopEyelashes
30408:usemtl BottomEyelashes
30457:usemtl Head
32364:usemtl Gums
32769:usemtl Tongue
32771:usemtl Gums
32816:usemtl Tongue
32818:usemtl TeethBottom
33449:usemtl TeethTop
34046:usemtl Head
35919:usemtl Tshirt3
37571:usemtl Tshirt3
40119:usemtl SkinBody
40199:usemtl Tshirt3
40776:usemtl SkinBody
41851:usemtl SkinBody
42499:usemtl SkinBody
42909:usemtl SkinBody
43547:usemtl FingerNails
43597:usemtl SkinBody
43698:usemtl FingerNails
43703:usemtl SkinBody
44060:usemtl SkinBody
44462:usemtl SkinBody
45231:usemtl FingerNails
45292:usemtl SkinBody
45421:usemtl FingerNails
45428:usemtl SkinBody
45791:usemtl SkinBody
46193:usemtl SkinBody
46953:usemtl FingerNails
47012:usemtl SkinBody
47141:usemtl FingerNails
47144:usemtl SkinBody
47508:usemtl SkinBody
47910:usemtl SkinBody
48670:usemtl FingerNails
48737:usemtl SkinBody
48859:usemtl FingerNails
48862:usemtl SkinBody
49223:usemtl SkinBody
49611:usemtl SkinBody
50392:usemtl FingerNails
50459:usemtl SkinBody
50590:usemtl FingerNails
50593:usemtl SkinBody
52220:usemtl Tshirt3
53872:usemtl Tshirt3
56420:usemtl SkinBody
56500:usemtl Tshirt3
57077:usemtl SkinBody
58152:usemtl SkinBody
58800:usemtl SkinBody
59161:usemtl SkinBody
59832:usemtl FingerNails
59882:usemtl SkinBody
59999:usemtl FingerNails
60004:usemtl SkinBody
60361:usemtl SkinBody
60763:usemtl SkinBody
61532:usemtl FingerNails
61593:usemtl SkinBody
61722:usemtl FingerNails
61729:usemtl SkinBody
62092:usemtl SkinBody
62494:usemtl SkinBody
63254:usemtl FingerNails
63313:usemtl SkinBody
63442:usemtl FingerNails
63445:usemtl SkinBody
63809:usemtl SkinBody
64211:usemtl SkinBody
64971:usemtl FingerNails
65038:usemtl SkinBody
65160:usemtl FingerNails
65163:usemtl SkinBody
65518:usemtl SkinBody
65905:usemtl SkinBody
66692:usemtl FingerNails
66759:usemtl SkinBody
66891:usemtl FingerNails
66894:usemtl SkinBody
72375:usemtl pants
77647:usemtl pants
90003:usemtl SoleShoe
90019:usemtl Sole
90021:usemtl SoleShoe
90023:usemtl Sole
90026:usemtl SoleShoe
90029:usemtl Sole
90033:usemtl SoleShoe
90035:usemtl Sole
90039:usemtl SoleShoe
90041:usemtl Sole
90045:usemtl SoleShoe
90047:usemtl Sole
90051:usemtl SoleShoe
90071:usemtl Sole
90073:usemtl SoleShoe
90077:usemtl Sole
90079:usemtl SoleShoe
90083:usemtl Sole
90085:usemtl SoleShoe
90089:usemtl Sole
90091:usemtl SoleShoe
90095:usemtl Sole
90097:usemtl SoleShoe
90120:usemtl Sole
90122:usemtl SoleShoe
90126:usemtl Sole
90128:usemtl SoleShoe
90132:usemtl Sole
90134:usemtl SoleShoe
90138:usemtl Sole
90140:usemtl SoleShoe
90210:usemtl Sole
90213:usemtl SoleShoe
90216:usemtl Sole
90219:usemtl SoleShoe
90222:usemtl Sole
90224:usemtl SoleShoe
90227:usemtl Sole
90229:usemtl SoleShoe
90232:usemtl Sole
90234:usemtl SoleShoe
90237:usemtl Sole
90239:usemtl SoleShoe
90242:usemtl Sole
90244:usemtl SoleShoe
90247:usemtl Sole
90249:usemtl SoleShoe
90252:usemtl Sole
90254:usemtl SoleShoe
90257:usemtl Sole
90259:usemtl SoleShoe
90893:usemtl Sole
90917:usemtl SoleShoe
91066:usemtl Sole
91724:usemtl laces
92157:usemtl bow
92964:usemtl Sole
92982:usemtl SkinBody
93038:usemtl pants
93614:usemtl SoleShoe
93621:usemtl Sole
93624:usemtl SoleShoe
93627:usemtl Sole
93663:usemtl laces
93696:usemtl Sole
93720:usemtl SkinBody
93732:usemtl pants
96325:usemtl SoleShoe
96708:usemtl Sole
97107:usemtl SoleShoe
97110:usemtl Sole
102691:usemtl pants
108002:usemtl pants
120358:usemtl SoleShoe
120374:usemtl Sole
120376:usemtl SoleShoe
120378:usemtl Sole
120381:usemtl SoleShoe
120384:usemtl Sole
120388:usemtl SoleShoe
120390:usemtl Sole
120394:usemtl SoleShoe
120396:usemtl Sole
120400:usemtl SoleShoe
120402:usemtl Sole
120406:usemtl SoleShoe
120426:usemtl Sole
120428:usemtl SoleShoe
120432:usemtl Sole
120434:usemtl SoleShoe
120438:usemtl Sole
120440:usemtl SoleShoe
120444:usemtl Sole
120446:usemtl SoleShoe
120450:usemtl Sole
120452:usemtl SoleShoe
120475:usemtl Sole
120477:usemtl SoleShoe
120481:usemtl Sole
120483:usemtl SoleShoe
120487:usemtl Sole
120489:usemtl SoleShoe
120493:usemtl Sole
120495:usemtl SoleShoe
120565:usemtl Sole
120568:usemtl SoleShoe
120571:usemtl Sole
120574:usemtl SoleShoe
120577:usemtl Sole
120579:usemtl SoleShoe
120582:usemtl Sole
120584:usemtl SoleShoe
120587:usemtl Sole
120589:usemtl SoleShoe
120592:usemtl Sole
120594:usemtl SoleShoe
120597:usemtl Sole
120599:usemtl SoleShoe
120602:usemtl Sole
120604:usemtl SoleShoe
120607:usemtl Sole
120609:usemtl SoleShoe
120612:usemtl Sole
120614:usemtl SoleShoe
121248:usemtl Sole
121272:usemtl SoleShoe
121421:usemtl Sole
122079:usemtl laces
122512:usemtl bow
123319:usemtl Sole
123337:usemtl SkinBody
123393:usemtl pants
123969:usemtl SoleShoe
123976:usemtl Sole
123979:usemtl SoleShoe
123982:usemtl Sole
124018:usemtl laces
124051:usemtl Sole
124075:usemtl SkinBody
124087:usemtl pants
126680:usemtl SoleShoe
127063:usemtl Sole
127462:usemtl SoleShoe
127465:usemtl Sole

The good news is many of the parts i wanted to remove are quite clearly seperated out, including tongues, teeth, eyelashes, fingernails, eye parts. The bad news for James Casual is the shoes which look to have been designed by a different (and messier) 3d modeller , making it very fiddly (like a days work) to seperate what you don’t want like shoelaces & inner soles. On the plus side you only have to do this once as every Poser pose of James Casual will always export the polygons in exactly the same order.

So now i have a program written in Java which takes an OBJ file and tidies it up. Unfortunately even when this is imported into Rhino (and then Joined, FillMeshHoles, UnifyMeshNormals to create a mesh with no naked edges), when you try and BooleanUnion this with another tidied figure Rhino can’t handle this. There may be ways around this – the problem stems from the FillMeshHole instruction filling holes which don’t exist (like across the midriff) in terms of the overall figure – but Rhino isn’t to know this and looks to fill across any mesh edges even those already Joined. One idea i’m looking at is to export all the Legs individually and fill these. Then union the legs, then do the same for the other body sections- eg chest,head,feet, arms and then reunite the parts later. But this seems like a lot of unnecessary unioning. Secondly there are a bunch of export variables from Poser which may help like Welding joins etc.

As i hope to BooleanUnion something like 200 figures (for a man walking across a room) i’ll need a safer process – when i get back to college and can use Magics STL again i think it will be able to handle these BooleanUnions, as i did with the Golem figure, but that’s why that software costs £4000 and Rhino costs £100. I’m looking to try and get an extended trial with the Materialise people (the sellers of Magics who work with artists including Peter Jansen) or other software solutions – i must have tried at least 15 different 3d modelling packages by now. I note that Peter is currently only making figures with about 30 unions so perhaps even magics would be stretched by more. So out of continuing frustration, and after seeing that i can get my hands on the actual 3d data, i decided to test out a radically different approach which may solve the Union problem and also differentiate my work from Peter’s.


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: