STEAM GROUP
Blender Source Tools BleST
STEAM GROUP
Blender Source Tools BleST
349
IN-GAME
2,130
ONLINE
Founded
8 November, 2013
All Discussions > Help > Topic Details
Kerristrasz 15 Mar, 2022 @ 5:54pm
Extra faces when exporting model
I've made a model that appears fine in Blender, but when I go to export it, I get a bunch of extra triangles where there should be a gap. I tried removing the collision model to see if that changed anything, and I got the same result. I have a feeling the problem has something to do with the reference mesh being concave, but from my searching online it doesn't seem like that's an issue. What exactly am I doing wrong here?

Blend file: https://pasteall.org/blend/5b83f349e3c34c01ae21e8bbae70b955
Qc file:
$modelname "props_doors/time2mine/oak_door.mdl" $scale 1 $surfaceprop "Wood" $staticprop $body mybody "oak_door.dmx" $sequence idle "oak_door.dmx" fps 1 $collisionmodel "oak_door_phys.dmx" { $concave }
Resulting model: https://imgur.com/a/1dHcs4J
Originally posted by Zappy:
Originally posted by java.lang.SkillException:
- I have a feeling the problem has something to do with the reference mesh being concave, -
That's correct. StudioMDL's triangulation can sometimes mess up with concave polygons, so you should cut the concave polygon into multiple convex polygons instead.

For example, picture that your polygon's edge is a road, and place an imaginary car on it.
Can the car complete an entire lap around the polygon while only turning clockwise (or only counter-clockwise)? If so, it's convex, which is good.
But if it has to turn the other way at some point, the polygon is concave, and you have to split it (at the point where the car turns the second way) to try making multiple convex polygons instead.

In other words, the outside edge must always curve "inward", never "outward". If it curves "outward", you have to cut it where it starts curving out (even if this is for every vertex along a curve).


TL;DR: In this example image (with a cherry pin instead of a door), you'd have to cut at the blue lines in https://imgur.com/LBcHTXE ...or alternatively just use Blender's "Triangulate Faces" option to turn the polygon entirely into triangles.
< >
Showing 1-2 of 2 comments
The author of this thread has indicated that this post answers the original topic.
Zappy 16 Mar, 2022 @ 8:06am 
Originally posted by java.lang.SkillException:
- I have a feeling the problem has something to do with the reference mesh being concave, -
That's correct. StudioMDL's triangulation can sometimes mess up with concave polygons, so you should cut the concave polygon into multiple convex polygons instead.

For example, picture that your polygon's edge is a road, and place an imaginary car on it.
Can the car complete an entire lap around the polygon while only turning clockwise (or only counter-clockwise)? If so, it's convex, which is good.
But if it has to turn the other way at some point, the polygon is concave, and you have to split it (at the point where the car turns the second way) to try making multiple convex polygons instead.

In other words, the outside edge must always curve "inward", never "outward". If it curves "outward", you have to cut it where it starts curving out (even if this is for every vertex along a curve).


TL;DR: In this example image (with a cherry pin instead of a door), you'd have to cut at the blue lines in https://imgur.com/LBcHTXE ...or alternatively just use Blender's "Triangulate Faces" option to turn the polygon entirely into triangles.
Kerristrasz 16 Mar, 2022 @ 10:57am 
Originally posted by Zappy:
...or alternatively just use Blender's "Triangulate Faces" option to turn the polygon entirely into triangles.
Yep, that worked perfectly. Thanks!
< >
Showing 1-2 of 2 comments
Per page: 1530 50

All Discussions > Help > Topic Details