Comments (10)
Of course, with that function commented out you will not get any visualization.
What version of OCC do you use? Note that Chrono can only work with version 7.4.0. And in that version, both functions Poly_Triangulation::Nodes() and Poly_Triangulation::Normals() are defined.
from chrono.
Thank you for your prompt reply
Yes, I use opencascade-7.7.0. I will try to recompile and link to the OCC 7.4.0 and hope the problem will be solved.
Thanks again and have a nice day
from chrono.
Hi again,
I have redone the installation with OCC 7.4.0 but am still unable to visualize the loaded step files, nor ChBodyEasySphere or ChBodyEasyBox when their add function is called from a GUI button's event function. I can visualize them only when called in the Main function before
vis->AttachSystem(&sys);
vis->SetWindowSize(800, 600);
vis->SetWindowTitle("ChCascade");
vis->Initialize();
....and the other settings
Please note that when I do "sys->Clear();" from the button's event function the objects disappear, meaning the reference to the sys is working well. Do I miss anything to show the added objects?
What do you advise in this case?
from chrono.
When you add a physics item (such as a body) to the system after the associated visual system was initialized, you must explicitly inform the visual system of the new assets (the item's visual model). You do this by explicitly invoking the function ChVisualSystem::BindItem()
. Note that all visual models defined at the time you initialize the visual system are automatically bound (so no need for any explicit call in that case).
from chrono.
Great, thanks
However, now the added elements just float. How can I add the physical attributes to them?
For example, the same objects fall down when I call them from the Main
from chrono.
This is likely some bug in your code. Not sure what you mean by "adding the physical attributes". Are you sure you do not set them as "fixed"?
from chrono.
Thanks for your prompt reply
Yes, I am sure they are not fixed. They fall when they are called from the main function....
About "adding the physical attributes", I meant to make them fall as a physical object not stay afloat.
Should you need any further details, please do not hesitate to ask. Thank you in advance.
from chrono.
Hi again @rserban
Please, let me clarify the issue:
I am calling the function "AddFallingItems(sys)" that exists in the demo: "demo_MBS_collisionNSC.cpp" from a button. Now the items are visible and everything is OK (after installing the right OCC 7.4.0 and binding the elements.)
However, when I call the function from the main, the items fall as they do in the demo but when I call it from the button, they do not fall unless they touch the falling items loaded from the main. When the items loaded from the main are no longer falling, i.e. they touch the bottom of the container "AddContainer", the newly added items stay at their positions and do not fall (this also applies to the items loaded using the LoadStepModel(....))
I tried to update the ChSystemNSC sys (sys.Update()) but it seems it has no effect!
Have I missed anything?
Thank you in advance
from chrono.
There must be a mistake somewhere in your code. A very simple modification of demo_MBS_collisionNSC where the falling objects are created at some later point in the simulation, using something like:
bool create = true;
while (vis->Run()) {
if (create && sys.GetChTime() > 3) {
AddFallingItems(sys, vis);
create = false;
}
vis->BeginScene();
vis->Render();
vis->EndScene();
sys.DoStepDynamics(step_size);
rt.Spin(step_size);
}
postponing the generation of falling objects and with an appropriately modified AddFallingItems()
to pass the visualization system so that the newly created bodies can be bound to the vis system, works exactly as expected.
from chrono.
Thank you so much indeed for your time and effort
You are right, the problem was in my code as I sat "sys.SetUseSleeping(true);" to test something and forgot to reset it back to false, or delete it!
In case someone faced the final issue I mention here, just turn this feature off!
/// Turn on this feature to let the system put to sleep the bodies whose
/// motion has almost come to a rest. This feature will allow faster simulation
/// of large scenarios for real-time purposes, but it will affect the precision!
/// This functionality can be turned off selectively for specific ChBodies.
void SetUseSleeping(bool ms) { use_sleeping = ms; }
Thanks again and have a great day :)
from chrono.
Related Issues (20)
- The ARM64 development board performs a make check error HOT 1
- terrain HOT 1
- FEA mesh and rigid body contacts, there is a difference between the theoretical solution and the results. HOT 1
- Includes don't work correctly when building my project HOT 1
- AttributeError:'ChSystemNSC' object has no attribute 'SetVisualSystem' HOT 14
- ModuleNotFoundError: No module named 'pychrono' on M1 Mac HOT 5
- ImportError: cannot import name '_core' from partially initialized module 'pychrono' (most likely due to a circular import)
- ChronoEngine Installation Issue on Ubuntu 23.10 with CMake 3.27.4: CHRONO_MPI_FOUND Variable Not Recognized in ChronoConfig.cmake HOT 6
- Chrono::Irrlicht and Chrono::Sensor sampling textures in opposite directions
- unable to use gpu HOT 1
- Certain fsi demos are not compatible with latest version of Chrono HOT 2
- PyChrono ChFunction example is out of date HOT 2
- How to use project chrono in QT? HOT 1
- How to simulate soil environment HOT 1
- How to add object after Render HOT 1
- Bug in FindThrust.cmake that breaks Chrono Multicore cmake build HOT 3
- Dockerfile for uwsbel/packages:ubuntu HOT 2
- demo_VEH_WheeledJSON.cpp visual does not render in low frequency HOT 1
- Bug? OpenGL does not work in combination with direct solvers HOT 4
- Viper
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 chrono.