Comments (4)
Hi there,
Thank you for the detailed repro case. I was able to confirm your results here, and I believe this is an issue of loss of numerical precision.
When using a spacing of 0.15 there are ~4k particles in the shape matching constraint, when using spacing of 0.1 there are ~13k particles in the constraint (count scales with the inverse cube of the spacing). Because shape-matching has to compute a sum over all particles for the center of mass and moment matrices, it eventually runs out of numerical precision, and results in numerical drift in some arbitrary direction.
Unfortunately there is no easy solution to this other than to limit the number of particles in an individual constraint. One workaround could be e.g.: overlapping multiple shape-matching constraints and increasing the iteration count to achieve the desired stiffness.
We are looking at supporting triangle-based collision detection in the future, which would avoid some of these problems by decoupling the particle discretization from the shape representation.
Cheers,
Miles
from flex.
Hi Miles,
Thanks for the quick response! Triangle-based collision detection would be a great feature to have.
One other problem I'm having is Flex seems to be calculating the center of mass differently than my application does. I just add up all the vertex positions and multiply by the inverse of the point count. But the value I get doesn't match Flex. Could you tell me how Flex calculates the center of mass?
int pntCount = triMesh.getVertexCount();
for (int i = 0; i < pntCount; i++)
{
Vector3d pnt = points.row(i);
pBody->t.centerOfVertexMass += pnt.cast<float>();
}
pBody->t.centerOfVertexMass *= 1.f /(float)pntCount;
from flex.
Hi @Hurleyworks ,
maybe you're looking for function CalculateRigidCentersOfMass() in helpers.h (in the "demo" folder)
from flex.
Thanks. Looks like that's new in 1.2 and I've been using Flex 1.1 until 1.2 is out of beta.
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? HOT 1
- 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.