Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Strange second tool "corkscrew tail" behavior #53

Open
epernod opened this issue Sep 16, 2022 · 0 comments
Open

Strange second tool "corkscrew tail" behavior #53

epernod opened this issue Sep 16, 2022 · 0 comments
Labels
bug Something isn't working

Comments

@epernod
Copy link
Contributor

epernod commented Sep 16, 2022

When using very small tip length/spireDiameter The edge Discretization behave strangely. Or problem of rigidity or beamMapping ?

SOFA.v22.12.99.-.C__projects_sofa_plugins_SofaLnRobotics_scenes_Demo_02_synthetic_data.scn.2022-09-16.09-59-47.-.0.00.02-0.00.14.mp4

Scene to reproduce the behavior

<?xml version="1.0"?>
<Node name="root" dt="0.05"  gravity="0 0 0"> 
	<Node name="Plugins">
        <RequiredPlugin name="Sofa.GL.Component.Rendering3D"/> <!-- Needed to use components [OglModel] -->  
        <RequiredPlugin name="Sofa.Component.Visual"/> <!-- Needed to use components [VisualStyle] -->  
        <RequiredPlugin name="Sofa.Component.Topology.Mapping"/> <!-- Needed to use components [Edge2QuadTopologicalMapping] -->  
        <RequiredPlugin name="Sofa.Component.Topology.Container.Grid"/> <!-- Needed to use components [RegularGridTopology] -->  
        <RequiredPlugin name="Sofa.Component.Topology.Container.Dynamic"/> <!-- Needed to use components [EdgeSetGeometryAlgorithms, EdgeSetTopologyContainer, EdgeSetTopologyModifier, QuadSetGeometryAlgorithms, QuadSetTopologyContainer, QuadSetTopologyModifier] -->  
        <RequiredPlugin name="Sofa.Component.Topology.Container.Constant"/> <!-- Needed to use components [MeshTopology] -->  
        <RequiredPlugin name="Sofa.Component.StateContainer"/> <!-- Needed to use components [MechanicalObject] -->  
        <RequiredPlugin name="Sofa.Component.SolidMechanics.Spring"/> <!-- Needed to use components [RestShapeSpringsForceField] -->  
        <RequiredPlugin name="Sofa.Component.SceneUtility"/> <!-- Needed to use components [InfoComponent] -->  
        <RequiredPlugin name="Sofa.Component.ODESolver.Backward"/> <!-- Needed to use components [EulerImplicitSolver] -->  
        <RequiredPlugin name="Sofa.Component.Mapping.Linear"/> <!-- Needed to use components [IdentityMapping] -->  
        <RequiredPlugin name="Sofa.Component.LinearSolver.Direct"/> <!-- Needed to use components [BTDLinearSolver] -->  
        <RequiredPlugin name="Sofa.Component.IO.Mesh"/> <!-- Needed to use components [MeshOBJLoader] -->  
        <RequiredPlugin name="Sofa.Component.Constraint.Projective"/> <!-- Needed to use components [FixedConstraint] -->  
        <RequiredPlugin name="Sofa.Component.Constraint.Lagrangian.Solver"/> <!-- Needed to use components [LCPConstraintSolver] -->  
        <RequiredPlugin name="Sofa.Component.Constraint.Lagrangian.Correction"/> <!-- Needed to use components [LinearSolverConstraintCorrection] -->  
        <RequiredPlugin name="Sofa.Component.Collision.Response.Contact"/> <!-- Needed to use components [DefaultContactManager] -->  
        <RequiredPlugin name="Sofa.Component.Collision.Geometry"/> <!-- Needed to use components [LineCollisionModel, PointCollisionModel, TriangleCollisionModel] -->  
        <RequiredPlugin name="Sofa.Component.Collision.Detection.Intersection"/> <!-- Needed to use components [LocalMinDistance] -->  
        <RequiredPlugin name="Sofa.Component.Collision.Detection.Algorithm"/> <!-- Needed to use components [BVHNarrowPhase, BruteForceBroadPhase, DefaultPipeline] -->  
        <RequiredPlugin name="Sofa.Component.AnimationLoop"/> <!-- Needed to use components [FreeMotionAnimationLoop] -->  
        <RequiredPlugin name="BeamAdapter" />
	</Node>
    <VisualStyle displayFlags="hideVisualModels showBehaviorModels hideMappings hideForceFields showCollisionModels" />
 	<DefaultVisualManagerLoop/>

 	<FreeMotionAnimationLoop />
	<LCPConstraintSolver mu="0.1" tolerance="1e-4" maxIt="1000" build_lcp="false" />
	
    <DefaultPipeline depth="6" verbose="1" draw="0"/>
    <BruteForceBroadPhase/>
    <BVHNarrowPhase/>
    <LocalMinDistance name="localmindistance" alarmDistance="0.2" contactDistance="0.1" angleCone="0.02"/>
    <DefaultContactManager name="Response" response="FrictionContactConstraint" />

	<Node name="GuideCatheter">
		<WireRestShape template="Rigid3d" name="GC_RestShape" length="500.0" straightLength="499.5" 
            spireDiameter="0.4" spireHeight="0.0" radius="1" massDensity="0.1" poissonRatio="0.3"
			densityOfBeams="350 5" numEdgesCollis="350 10" 
            youngModulus="400" youngModulusExtremity="200" />

		<EdgeSetTopologyContainer name="GC_mesh" />
		<EdgeSetTopologyModifier />
		<EdgeSetGeometryAlgorithms template="Rigid3d" />
		<MechanicalObject name="GC_dof" template="Rigid3d" />
	</Node>


	<Node name='GuideWire'>
		<WireRestShape template='Rigid3d' name='GW_RestShape' length='100.0'  straightLength='99.8' 
            spireDiameter='0.15' spireHeight='0.0' radius="1"
			densityOfBeams='350 6' numEdgesCollis='350 6'  
            youngModulus='200' youngModulusExtremity='100'/>
            
		<EdgeSetTopologyContainer name='GW_mesh' />
		<EdgeSetTopologyModifier />
		<EdgeSetGeometryAlgorithms template='Rigid3d' />
		<MechanicalObject template='Rigid3d' name='GC_dof' />
	</Node>


    <Node name="Instrument">
        <EulerImplicitSolver rayleighStiffness="0.2" rayleighMass="0.1" />
        <BTDLinearSolver />
        <RegularGridTopology name="MeshLines" nx="60" ny="1" nz="1"
            xmax="0.0" xmin="0.0" ymin="0" ymax="0" zmax="0" zmin="0"
            p0="0 0 0" drawEdges="0"/>
                                
        <MechanicalObject name="Instrument_DOFs" template="Rigid3d" translation="96.0 6.0 6.5" rotation="0 30 -70" /> 
        
        <WireBeamInterpolation name="Interpol_GCatheter" WireRestShape="@../GuideCatheter/GC_RestShape" radius="0.05" printLog="0"/> 
		<AdaptiveBeamForceFieldAndMass name="FF_GCatheter" interpolation="@Interpol_GCatheter" massDensity="0.00000155"/>

		<WireBeamInterpolation name='Interpol_GWire' WireRestShape='@../GuideWire/GW_RestShape' radius='0.01' printLog='0'/> 
		<AdaptiveBeamForceFieldAndMass name='FF_GWire' interpolation='@Interpol_GWire' massDensity='0.0000000155'/> 	



        <InterventionalRadiologyController name="IRController" template="Rigid3d" listening="true" controlledInstrument="0" 
            instruments="Interpol_GCatheter Interpol_GWire" printLog="0" 
            speed="0"  step="0.1" startingPos="96.0 6.0 6.5   0 0 0 1" 
            rotationInstrument="0 0 0" xtip="0 0 0"  />


        <LinearSolverConstraintCorrection printLog="false" wire_optimization="true"/>
        
        <FixedConstraint name="FixedConstraint" indices="0" />
        <RestShapeSpringsForceField  points="@IRController.indexFirstNode" stiffness="1e8" angularStiffness="1e8" />

        <Node name="Instrument_collision" activated="true">
				<EdgeSetTopologyContainer name="IC_mesh"/>
				<EdgeSetTopologyModifier />
				<MechanicalObject name="IC_dofs"/>
				<MultiAdaptiveBeamMapping  name="IC_MultiBeamMapping" controller="../IRController" useCurvAbs="1" printLog="0"/> 
				<LineCollisionModel proximity="0.0" group="1"/>
				<PointCollisionModel proximity="0.0" group="1"/>
		</Node>	
    </Node>
</Node>

@epernod epernod added the bug Something isn't working label Sep 16, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant