Comments (9)
I added some tests where the speed increases over time. Unfortunately without great success.
from flex.
Hi there,
If increasing subsets is not helping it may leaking because of the internal limit of 6 contact planes per-particle. Because each triangle contributes a plane highly tessellated objects will easily overflow this limit. You might find that using a simpler triangle mesh, or a convex decomposition of the object and setting convex shapes would yield better results.
I will look into exposing this internal limit for a future build so that you could at least experiment with increasing it at the cost of some additional memory.
Cheers,
Miles
from flex.
Hi Miles,
Thank you very much for your answer.
After reducing the geometry tesselation, fluid behaviour really improved, but the object shape itself then cannot be so smooth curved as wanted, It would be great to have the ability to increase the internal limit. Thanks for looking into it.
convex decomposition of Cup0.obj would cause 32 pieces plus the floor Piece.
UPDATED: 96 pieces required. (new Cup4.obj has better mesh topology)
from flex.
from flex.
During testing SDF as collision constraint for the Cup (yet I did not test convex decomposition) I noticed a memory leak, each time when pressing "R" in the "Shape Collision" sample scene. So I thought I should report it here.
in helper.h within the "CreateSDF" function I added
delete[] pfm.m_data;
but this alone did not solve all of that leak.
from flex.
Thanks Sheila, have checked in a fix that should make it for the final 1.2 release.
Cheers,
Miles
from flex.
SDF did not gave me the expected results, so I tried
convex decomposition meshes on a very low tesselation level, still using triangle mesh collision:
Cup0.obj uses 256 vertices with 508 faces
CupConvexDecom32_0_000.obj uses 32 vertices with 60 faces
CupConvexDecom64_0_000.obj uses 64 vertices with 124 faces
CupConvexDecom32_0_000.obj uses 32 vertices with 60 faces
Through the convex decomposition even the shape of the object has massivly changed,
but unfortunately some fluid still goes through the material.
ConvexDecompositionCupTest0.wmv (60fps) uses a smooth speed up within 100 frames (1.6 seconds)
from 0.01 units/frame to final speed 0.1 units/frame on FLEX_RADIUS = 0.1
USE_SUBSTEPS = 12
USE_ITERATIONS = 6
COLLISION_DISTANCE = FLEX_RADIUS * 0.5
Still fluid leaves after short time
ConvexDecompositionCupTest1.wmv (60fps) uses a smooth speed up within 600 frames (10 seconds)
from 0.01 units/frame to final speed 0.1 units/frame on FLEX_RADIUS = 0.065
USE_SUBSTEPS = 12
USE_ITERATIONS = 6
COLLISION_DISTANCE = FLEX_RADIUS * 0.5
Still fluid leaves after short time.
CupConvexDecom64_0_000.obj uses 64 vertices with 124 faces
ConvexDecompositionCupTest2.wmv (60fps) uses a smooth speed up within 600 frames (10 seconds)
from 0.01 units/frame to final speed 0.1 units/frame on FLEX_RADIUS = 0.065
USE_SUBSTEPS = 12
USE_ITERATIONS = 6
COLLISION_DISTANCE = FLEX_RADIUS * 0.5
fluid is ok during speed up, but when it stops to speed 0 abrupt directly, the fluid
still does not leave the cup where it should. instead it leaves through material
ConvexDecompositionCupTest3.wmv (60fps) uses a smooth speed up within 600 frames (10 seconds)
from 0.01 units/frame to final speed 0.2 units/frame on FLEX_RADIUS = 0.065
USE_SUBSTEPS = 12
USE_ITERATIONS = 6
COLLISION_DISTANCE = FLEX_RADIUS * 0.5
fluid is leaving after half time (where speed is at ~0.095
= (0.2 - 0.01) * ((cos(180° + 180° * (300/600)) * 0.5)+0.5)
= (0.2 - 0.01) * ((0 * 0.5)+0.5)
0.1 units/frame = 6.0 units/second (on 60fps)
=> on decimeter units 6.0/second = 0.6 meter/second = 2.16 km/h
result:
the number of faces sharing a vertex can even be bigger than 6 on convex decompositioned meshes.
see convex32.jpg, convex64.jpg, org_cup0.jpg
Normally a quad-based mesh topology would be best, but the automatic convex decomposition algo I used, don't produce them.
from flex.
Manual decomposition with a completely different topology now succeeds on triangle mesh collision.
See CupMeshTopology.jpg (there 4 faces are mentioned; when trianglulated, these are actually 5)
MoreConvexDecompositionTests.zip
I updated again the Cup mesh (some double Vertices removed, so that ist clearer)
Cup4.zip
VIDEO_20171007_013852_0.wmv (60fps) uses a smooth speed up within 600 frames (10 seconds)
from 0.01 units/frame to final speed 0.2 units/frame on FLEX_RADIUS = 0.065
USE_SUBSTEPS = 12
USE_ITERATIONS = 6
COLLISION_DISTANCE = FLEX_RADIUS * 0.5
However, still when running at Speed 0.2 and then stopping abrupt to speed 0, the fluid still leaves through the material.
So next I'll try the cup as 96 eNvFlexShapeConvexMesh's out of combined triangles.
96 pieces = (32 quads of upper part to triangles = 64 triangles) and 32 triangles for bottom.
Hope that it gives better results.
from flex.
so finally I decompositioned the mesh in Cup4.obj (130 vertices, 256 faces)
into 96 convex objects (applied as eNvFlexShapeConvexMesh).
(more about how I did that, and the final 96 plane definitions are in 96convex_objects.txt)
Unfortunately the fluid is still leaving through the material.
Even after I increased the plane distances of each convex object, the fluid leaves.
96ConvexDecom.zip
96convexDecompositionBodiesOverlapping_1_0.wmv (convexes with original distances)
96convexDecompositionBodiesOverlapping_1_5.wmv (bigger convexes, which overlap)
both test videos (60fps) use a smooth speed up within 600 frames (10 seconds)
from 0.01 units/frame to final speed 0.2 units/frame on FLEX_RADIUS = 0.065
USE_SUBSTEPS = 12
USE_ITERATIONS = 6
COLLISION_DISTANCE = FLEX_RADIUS * 0.5
The blue/cyan visible mesh/solid objects in the videos are the convex objects, not the real mesh. The real mesh object is completely hidden in these test videos.
CompareOverlapping.jpg shows how the convex objects overlap.
NOTE: of course I negated all the distances within the plane definitions.
All convex objects have exactly 5 planes, describing them.
Are there more parameters to ensure for convex object's ?
So the best working solution for me yet is using a mesh topology with 6 or less triangles sharing a vertex, with triangle mesh collision.
With the exception, that abrupt speed changes still cause the problem; such when a 3D person holds the cup, moves the arm fast and stops immediately.
from flex.
Related Issues (20)
- Simulating penetrative interaction
- Help Game Partners Migrate
- In Unity is MapParticleData -> NvFlexMap the expected performance bottleneck?
- Port to vcpkg for easy building / inclusion
- rotation of eNvFlexShapeSphere
- Register D3D12 Buffer to Flex
- D3D12 NvFlexUpdateTriangleMesh failed
- Unity 8.Oct.2021 Unfortunately, NVIDIA FleX for Unity (1.0 BETA) is no longer available. HOT 8
- granular particles in Flex behaving oddly - sleepThreshold bug? HOT 1
- 0xC0000005: Access violation reading location 0xFFFFFFFFFFFFFFFF
- Two bugs I found in Flex
- Plastic deformation time-step sensitivity.
- Documentation for SetRigids neglects soft body case
- Documentation allocates velocity buffers that are too large
- Documentation for SetPhases is out of date.
- Update signed distance fields collisions
- Flex is broken for any RTX Cards
- Does flex have camera sensors such as depth cameras? HOT 1
- Open sourcing Flex?
- How to access the force information in flex?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from flex.