
Mon, 07/05/2021 - 04:37
Forums:
Hi all
I want to show the bending process of the pipe like a animation.But I don't know how to make the process more smooth,just like a continuous process. But I don't know how to implement this process
Greatly appreciate any help
Mon, 07/05/2021 - 10:09
What have you tried so far (how your animation works right now) and what is the problem with the current approach?
Mon, 07/05/2021 - 12:13
Thanks Kirill,
But my animation don't work right now,because l don't know the method.
Such as I want to bend a 90 degree pipe, I can just subdivide 90 degrees, like 10 degrees, 20 degrees, 30 degrees..... 90 degrees, and each degree builds a model separately. Use BRepOffsetAPI_MakePipe class.
What I think was show each of these models at a very high speed, so that the end result was like an animation. And When I show a model, I clear the viewer and show the next model.But the result is very bad.
So I don't know if my idea is right, and if is right, how can I present every model at a very fast speed, so that it can like a smooth and continuous animation, or is there some other solution?
Sat, 07/10/2021 - 14:24
BRepOffsetAPI_MakePipe is designed to perform direct modeling, not animation, so that you cannot trivially compare shapes computed with different algorithm parameters.
In general, a smooth transition between two shapes can be implemented as:
This could be defined for entire object or to it's parts (like several joint/links of a robotic arm).
This is what AIS_AnimationObject allows to do out of the box.
but it cannot be trivially applied to algorithms like BRepOffsetAPI_MakePipe.
In such cases, object animation can be defined on simpler shapes as a "preview".
Two shapes are displayed simultaneously in the viewer with different transparency levels.
This logic could be easily defined within AIS_Animation subclass.
In addition, complex transformation of a shape would require a lot of transient precomputed shape states consuming memory.
AIS_Animation subclass will execute BRepOffsetAPI_MakePipe algorithm for each drawn frame with interpolated parameters
and create TopoDS_Shape as well as triangulation for it's presentation anew.
Each mesh state defines the same number of nodes and the same indexation, with different nodal positions in initial and final states.
This approach is used often for animating characters in games
There is no straightforward way implementing this approach from results of algorithms like BRepOffsetAPI_MakePipe.
Any of these approaches could be extrapolated from just two states to a series of states (animation keyframes) to define a complex animation.
Each animation frame is defined by PTS (presentation timestamp), which is used as a factor for linear interpolation between two states (animation keyframes).