Skip to main content
10 events
when toggle format what by license comment
Jan 13, 2023 at 16:25 comment added Harry McKenzie wow oh i forgot about your gif that was pretty interesting haha i will try that tomorrow! but yeah its only supposed to work for manifold meshes XD
Jan 13, 2023 at 16:06 comment added Markus von Broady I was simply lucky that because the internal face was at Y=0, the calculation was yielding 0 for it, but when you move the object it's no longer the case. Also if you add internal faces not at Y=0. I still don't understand the logic and or limitations other than internal faces messing with the algorithm :D
Jan 13, 2023 at 16:05 comment added Markus von Broady Here's the steps I taken: Check the number of faces: 5. Create a loopcut with Ctrl+R, check the number of faces: 8 (3 quads converted to 6 quads). Fill the loopcut with a single triangular face, recheck number of faces: 9. It's a single face even after triangulation, it's not doubled going in both directions, and the last step, just creating an internal face in existing loop doesn't in any way change coordinates of other vertices, and yet it adds another face's "volume". I also calculated the volume for that face and it is 0 - until you move the object, that is.
Jan 13, 2023 at 15:09 comment added Harry McKenzie @MarkusvonBroady When the internal face is inside the mesh, it will have the opposite normal direction of the external faces, this means that the cross product of the vectors of the face will be pointing the opposite direction. So, the dot product will be negative. The volume of the tetrahedron formed by the internal face will be subtracted from the total volume.
Jan 13, 2023 at 15:09 comment added Harry McKenzie @MarkusvonBroady when u calculate the volume of a mesh with internal face, say a cuboid with an internal face that splits it, the script will still work because it is iterating over all the faces of the mesh, regardless of whether they are internal or external. The script calculates the volume of each face as a tetrahedron and adds it to the total volume. When it reaches an internal face, it also calculates its volume as a tetrahedron and adds it to the total volume. Because the internal face is part of the mesh, it is included in the calculation.
Jan 13, 2023 at 12:38 comment added Markus von Broady And once I have that internal face, moving the object around changes the volume for some reason… And internal face can be considered as producing invalid topology, but I still don't understand why creating the internal face doesn't change the volume by without moving the entire mesh/object... i.imgur.com/d4KjBPD.gif
Jan 13, 2023 at 12:29 comment added Markus von Broady I've dissolved one edge of the cuboid to make an extruded triangle with half volume of the cuboid (still correct volume displayed), then again added an internal face by ctrl+R, F, and volume stayed correct - but it's a single triangle, so what gives, the v1.dot(v2.cross(v3)) / 6 for this triangle is 0?
Jan 13, 2023 at 12:26 comment added Markus von Broady That's an interesting approximation. I don't quite understand the logic, it seems you could use the f.normal instead of v2.cross(v3)? Maybe not, because the cross product is not normalized? I tested with solidify and it seemed to work with that, I think it works because opposite normals cancel each-other. I tested with it with a sphere, and a sphere with a quarter of it cut off, and it works wonderfully each time. I added an internal face to a cuboid and since it's just one face it should either add to or subtract from the volume but it stayed correct. What gives ?!
Jan 13, 2023 at 12:01 history edited Harry McKenzie CC BY-SA 4.0
added 68 characters in body
Jan 13, 2023 at 11:35 history answered Harry McKenzie CC BY-SA 4.0