Planar relationship constraint #4124
AliceCatalano
started this conversation in
Ideas / Suggestions
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Good evening,
I am trying to implement something from some months but I tried every component related to it and still is not working, so I hoped I could find some suggestions here.
I have a simple cube mesh made soft and deformable through the Mass-Spring ForceField.
The idea is to define some flat areas of the surface of the cube, and constrain them in a planar relationship, and then change the orientation of the constrained plane to obtain different "slopes".
I tired PlaneConstraint, PlaneROI, ProjectToPlaneConstraint, yet I was not able to obtain the desired behavior, because I want the area enclosed in the 4 mesh indexes to be rigid, while in all the above cases it remained with the same deformable characteristics as the remaining mesh.
This is the scene
import Sofa
import os
import numpy as np
os.path.expanduser('~/Desktop/SOFA_v22.12.00_Linux/share/sofa/examples/Tutorials/Sofa_scene')
from imu1 import MyController
def createScene(root):
root.gravity = [0, 0, 0]
root.dt = 0.1
root.animate=True
root.addObject('OglSceneFrame', style="Arrows", alignment="TopRight")
root.addObject('MeshGmshLoader', name="Loaderk", filename="mesh/cube.msh")
"""the following coordinates are the coordinates of the 3 highlighted points on the mesh"""
square.addObject('PlaneROI', name='ProjectToPlane', plane=[[-0.018125, 0.05249999, 0.025, 0.018125, 0.05249999, 0.025, -0.018125, 0.0175, 0.025, 0.025]], position='@MechanicalModel.rest_position', drawBoxes=True)
square.addObject('ProjectToPlaneConstraint', name='ptpcN', normal=[0, 0, 0], indices='@ProjectToPlane.indices', origin= [0, 0.035, 0.025], drawSize=0.001, listening=1)
Beta Was this translation helpful? Give feedback.
All reactions