Forum Replies Created
-
AuthorPosts
-
epernodBlocked
Hi,
yes you are right, the
TopologyEngine
was a new mechanism to handle topological changes.
This work has not been totally finished, that is why you can find some duplicated mechanisms.The main idea was to change the previous mechanism that was propagating topological changes through the scene graph by a new one using only the Data graph dependencies.
Thus, each Data will automatically update itself only when his parentData is dirty and propagate the change to his children.It is very old for me now… so I will need to go deeper in the code if you want a full explaination but basically let’s take the example of the
TriangularFEMForcefield
.This FEM store several data/values for each triangle, edge and vertex, through the inner classes:
TriangleInformation
,EdgeInformation
andVertexInformation
Looking only at the triangles (but it is the same for each topological element), all the information on the triangulation is stored on a single Data:
TriangleData<sofa::helper::vector<TriangleInformation> > triangleInfo;
By default a
TriangleData
will be set as Child of the Data m_triangles (from the Topology Container) using the line of code:
triangleInfo.registerTopologicalData();
Thus, changing the number of triangles in the topology imply that the child Data triangleInfo is dirty and need an update.
This will be automatically handle by theTopologyEngine
if you add aTopologyHandler
to thatTriangleData
. You need to implement thatTopologyHandler
. Here it correspond to the class:
class TRQSTriangleHandler : public TopologyDataHandler<Triangle,vector<TriangleInformation> >
and you register it using the line of code:
triangleInfo.createTopologicalEngine(_topology, triangleHandler);
In this Handler you describes all the rules to create/destroy/… the corresponding Data. Look at the method for example:
void TriangularFEMForceField<DataTypes>::TRQSTriangleHandler::applyCreateFunction(
You can see the list of method to overwrite in the file
TopologyDataHandler.h
The event corresponding to the topological change is automatically handle from theTopologyEngine
, it will know which method to call between creation, destruction, swap of elements.Hope this is clear… at least it just removed a big pile of dust from my brain 🙂
Erik
18 December 2015 at 09:50 in reply to: [SOLVED] Showing indices and vertices of elements in run window #5165epernodBlockedHi,
You can see the vertex indices directly in the mechanicalObject, if you double click on the component in the graph. It is under table visualization.
Same for triangles if you use a TriangleSetGeometryAlgorithms component.
Erik
29 September 2015 at 09:21 in reply to: [SOLVED] Is TriangleSetTopologyModifier::removeTrianglesPostProcessing empty ? #3693epernodBlockedHi,
this is a method dedicated to child class of TriangleSetTopologyModifier.
It was done based on a “template method” design pattern (if my memory is good)
Basically in the method:TriangleSetTopologyModifier::removeTriangles(const sofa::helper::vector<unsigned int> &triangleIds, const bool removeIsolatedEdges, const bool removeIsolatedPoints) removeTrianglesPreconditions(..) // is called and if the preconditions are fulfill then removeTrianglesProcess(triangleIds_filtered ,removeIsolatedEdges, removeIsolatedPoints); // do the job and finally removeTrianglesPostProcessing(edgeToBeRemoved, vertexToBeRemoved); // is called to Arrange the current topology if needed.
if
removeIsolatedEdges
andremoveIsolatedPoints
are set to true (which are the default value) thenremoveTrianglesProcess
will remove isolated vertices/edges.
removeTrianglesPreconditions
andremoveTrianglesPostProcessing
have to be implemented in child class if you want to do more job around this removal (for example for Manifold Triangulation, where edges on border need to be oriented).Hope I was clear. Do not hesitate if you have more question.
You can check the triangle remove interaction in the scene: Demos/TriangleSurfaceCutting.scn using shift + right clickErik
epernodBlockedHi,
some research have been done in Lille and Sophia-Antipolis regarding tetrahedra subdivision and cutting. But from what I know, it has been developed and used in a private plugin.
As Weng said, you could use the caving engine if removing tetrahedra is enough. If you need a better and nicer solution to perform nice cut, you should contact one the researcher that Sarrami mentioned.
epernodBlockedHi,
great! but… I wanted to try it, the 2 links give me: Error 503 Service Unavailable
Erik
-
AuthorPosts