Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
Simulating Guidewires In Blood Vessels
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Robin Viellieber
Simulating Guidewires In Blood Vessels
Commits
d6a25b7a
Commit
d6a25b7a
authored
Dec 06, 2022
by
rv3Dcv
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add PerformCollisionTestThree()
parent
449ee0d3
Changes
8
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
5457 additions
and
24 deletions
+5457
-24
CollisionTestPerformer.cs
...ulation/Assets/Guidewire_Assets/CollisionTestPerformer.cs
+19
-14
CollisionTestScene_2Spheres(old).unity
...s/Guidewire_Assets/CollisionTestScene_2Spheres(old).unity
+0
-0
CollisionTestScene_2Spheres(old).unity.meta
...dewire_Assets/CollisionTestScene_2Spheres(old).unity.meta
+0
-0
CollisionTestScene_2Spheres_PrimitiveMeshPipe.unity
...ssets/CollisionTestScene_2Spheres_PrimitiveMeshPipe.unity
+5417
-0
CollisionTestScene_2Spheres_PrimitiveMeshPipe.unity.meta
.../CollisionTestScene_2Spheres_PrimitiveMeshPipe.unity.meta
+7
-0
CollisionTestScene_2Spheres_PrimitiveSphere.unity
..._Assets/CollisionTestScene_2Spheres_PrimitiveSphere.unity
+5
-1
CollisionTestScene_2Spheres_PrimitiveSphere.unity.meta
...ts/CollisionTestScene_2Spheres_PrimitiveSphere.unity.meta
+0
-0
EditorUserSettings.asset
...GuidewireSimulation/UserSettings/EditorUserSettings.asset
+9
-9
No files found.
GuidewireSimulation/GuidewireSimulation/Assets/Guidewire_Assets/CollisionTestPerformer.cs
View file @
d6a25b7a
...
...
@@ -13,6 +13,7 @@ public class CollisionTestPerformer : MonoBehaviour
[
SerializeField
]
bool
doCollisionTestOne
=
false
;
[
SerializeField
]
bool
doCollisionTestTwo
=
false
;
[
SerializeField
]
bool
doCollisionTestThree
=
false
;
float
startTime
=
0f
;
private
void
Awake
()
...
...
@@ -34,6 +35,7 @@ public class CollisionTestPerformer : MonoBehaviour
{
if
(
doCollisionTestOne
)
PerformCollisionTestOne
();
else
if
(
doCollisionTestTwo
)
StartCoroutine
(
PerformCollisionTestTwo
());
else
if
(
doCollisionTestThree
)
StartCoroutine
(
PerformCollisionTestThree
());
}
/**
...
...
@@ -49,6 +51,7 @@ public class CollisionTestPerformer : MonoBehaviour
simulationLoop
.
sphereExternalForces
[
simulationLoop
.
SpheresCount
-
1
]
=
pullForce
;
}
// force gets applied for a fixed time
private
IEnumerator
PerformCollisionTestTwo
(
float
applyForceTime
=
1.5f
)
{
for
(
int
sphereIndex
=
0
;
sphereIndex
<
(
simulationLoop
.
SpheresCount
-
1
);
sphereIndex
++)
...
...
@@ -68,23 +71,25 @@ public class CollisionTestPerformer : MonoBehaviour
Debug
.
Log
(
"End of Pull Phase of Collision Test Two"
);
}
// private IEnumerator PerformCollisionTestThree(float exitVelocity = 4f)
// {
// for (int sphereIndex = 0; sphereIndex < (simulationLoop.SpheresCount - 1); sphereIndex++)
// {
// simulationLoop.sphereExternalForces[sphereIndex] = Vector3.zero;
// }
// force gets applied until a fixed velocity is reached
private
IEnumerator
PerformCollisionTestThree
(
float
exitVelocity
=
4f
)
{
for
(
int
sphereIndex
=
0
;
sphereIndex
<
(
simulationLoop
.
SpheresCount
-
1
);
sphereIndex
++)
{
simulationLoop
.
sphereExternalForces
[
sphereIndex
]
=
Vector3
.
zero
;
}
simulationLoop
.
sphereExternalForces
[
simulationLoop
.
SpheresCount
-
1
]
=
pullForce
;
// simulationLoop.sphereExternalForces[simulationLoop.SpheresCount - 1] = pullForce;
// yield return new WaitForSeconds(applyForceTime
);
yield
return
new
WaitUntil
(()
=>
simulationLoop
.
sphereVelocities
[
simulationLoop
.
SpheresCount
-
1
].
z
>=
exitVelocity
);
//
simulationLoop.sphereExternalForces[simulationLoop.SpheresCount - 1] = Vector3.zero;
simulationLoop
.
sphereExternalForces
[
simulationLoop
.
SpheresCount
-
1
]
=
Vector3
.
zero
;
//
float timeDiff = Time.time - startTime;
//
Debug.Log("Elapsed time of collision test: " + timeDiff);
//
Debug.Log("Velocity at test end: " + simulationLoop.sphereVelocities[1].ToString("e2"));
// Debug.Log("End of Pull Phase of Collision Test Two
");
//
}
float
timeDiff
=
Time
.
time
-
startTime
;
Debug
.
Log
(
"Elapsed time of collision test: "
+
timeDiff
);
Debug
.
Log
(
"Velocity at test end: "
+
simulationLoop
.
sphereVelocities
[
1
].
ToString
(
"e2"
));
Debug
.
Log
(
"End of Pull Phase of Collision Test Three
"
);
}
}
}
\ No newline at end of file
GuidewireSimulation/GuidewireSimulation/Assets/Guidewire_Assets/CollisionTestScene_2Spheres.unity
→
GuidewireSimulation/GuidewireSimulation/Assets/Guidewire_Assets/CollisionTestScene_2Spheres
(old)
.unity
View file @
d6a25b7a
File moved
GuidewireSimulation/GuidewireSimulation/Assets/Guidewire_Assets/CollisionTestScene_2Spheres.unity.meta
→
GuidewireSimulation/GuidewireSimulation/Assets/Guidewire_Assets/CollisionTestScene_2Spheres
(old)
.unity.meta
View file @
d6a25b7a
File moved
GuidewireSimulation/GuidewireSimulation/Assets/Guidewire_Assets/CollisionTestScene_2Spheres_PrimitiveMeshPipe.unity
0 → 100644
View file @
d6a25b7a
This diff is collapsed.
Click to expand it.
GuidewireSimulation/GuidewireSimulation/Assets/Guidewire_Assets/CollisionTestScene_2Spheres_PrimitiveMeshPipe.unity.meta
0 → 100644
View file @
d6a25b7a
fileFormatVersion: 2
guid: 0f3f7ca7ef13e6a4cabee61af553f355
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
GuidewireSimulation/GuidewireSimulation/Assets/Guidewire_Assets/CollisionTestScene_2Spheres_
CustomPip
e.unity
→
GuidewireSimulation/GuidewireSimulation/Assets/Guidewire_Assets/CollisionTestScene_2Spheres_
PrimitiveSpher
e.unity
View file @
d6a25b7a
...
...
@@ -367,6 +367,10 @@ PrefabInstance:
objectReference
:
{
fileID
:
0
}
-
target
:
{
fileID
:
3901088838006394844
,
guid
:
0e128b35dc3ea6746b6de609560d672d
,
type
:
3
}
propertyPath
:
doCollisionTestTwo
value
:
0
objectReference
:
{
fileID
:
0
}
-
target
:
{
fileID
:
3901088838006394844
,
guid
:
0e128b35dc3ea6746b6de609560d672d
,
type
:
3
}
propertyPath
:
doCollisionTestThree
value
:
1
objectReference
:
{
fileID
:
0
}
-
target
:
{
fileID
:
4233146888435007088
,
guid
:
0e128b35dc3ea6746b6de609560d672d
,
type
:
3
}
...
...
@@ -415,7 +419,7 @@ PrefabInstance:
objectReference
:
{
fileID
:
0
}
-
target
:
{
fileID
:
4233146888435007091
,
guid
:
0e128b35dc3ea6746b6de609560d672d
,
type
:
3
}
propertyPath
:
timeStep
value
:
0.00
2
value
:
0.00
4
objectReference
:
{
fileID
:
0
}
-
target
:
{
fileID
:
4233146888435007091
,
guid
:
0e128b35dc3ea6746b6de609560d672d
,
type
:
3
}
propertyPath
:
fixedTimeStep
...
...
GuidewireSimulation/GuidewireSimulation/Assets/Guidewire_Assets/CollisionTestScene_2Spheres_
CustomPip
e.unity.meta
→
GuidewireSimulation/GuidewireSimulation/Assets/Guidewire_Assets/CollisionTestScene_2Spheres_
PrimitiveSpher
e.unity.meta
View file @
d6a25b7a
File moved
GuidewireSimulation/GuidewireSimulation/UserSettings/EditorUserSettings.asset
View file @
d6a25b7a
...
...
@@ -6,34 +6,34 @@ EditorUserSettings:
serializedVersion
:
4
m_ConfigSettings
:
RecentlyUsedScenePath-0
:
value
:
224247031146467c18070827072a4d1529360b39293c357f1d3b1227edf42d28e7d435ece93f
6b722c0ce6281d
value
:
224247031146467c18070827072a4d1529360b39293c357f1d3b1227edf42d28e7d435ece93f
006f0a12e739163b1271e704001fef
flags
:
0
RecentlyUsedScenePath-1
:
value
:
224247031146467c18070827072a4d1529360b39293c357f1d3b1227edf42d28e7d435ece93f006
9
0a12e739163b1271e704001fef
value
:
224247031146467c18070827072a4d1529360b39293c357f1d3b1227edf42d28e7d435ece93f006
e
0a12e739163b1271e704001fef
flags
:
0
RecentlyUsedScenePath-2
:
value
:
224247031146467
c18070827072a4d1529360b39293c357f1d3b1227edf42d28e7d435ece93f006f6931ff34012c042cbc1f0702e212
value
:
224247031146467
f080c192534315e071f191f0f343c233e3e20123dadc52c39eff73aeca81f273d3412e3394a2b0f36e613
flags
:
0
RecentlyUsedScenePath-3
:
value
:
224247031146467c18070827072a4d1529360b39293c357f1d3b1227edf42d28e7d435ece93f006
d
6931ff34012c042cbc1f0702e212
value
:
224247031146467c18070827072a4d1529360b39293c357f1d3b1227edf42d28e7d435ece93f006
f
6931ff34012c042cbc1f0702e212
flags
:
0
RecentlyUsedScenePath-4
:
value
:
224247031146467c18070827072a4d1529360b39293c357f1d3b1227edf42d28e7d435ece93f006
e
6931ff34012c042cbc1f0702e212
value
:
224247031146467c18070827072a4d1529360b39293c357f1d3b1227edf42d28e7d435ece93f006
d
6931ff34012c042cbc1f0702e212
flags
:
0
RecentlyUsedScenePath-5
:
value
:
224247031146467c18070827072a4d1529360b39293c357f
1d3b1227edf42d28e7d435ece93f006f0a12e739163b1271e704001fef
value
:
224247031146467c18070827072a4d1529360b39293c357f
0e26113febf33d37ecd333faf3093c393707d06e372e093ae00f1a34d51e191f1e03cd0701fa5e061fcc0cdc
flags
:
0
RecentlyUsedScenePath-6
:
value
:
224247031146467c18070827072a4d1529360b39293c357f
1d3b1227edf42d28e7d435ece93f006e0a12e739163b1271e704001fef
value
:
224247031146467c18070827072a4d1529360b39293c357f
0e26113febf33d37ecd333faf3093c393707d06c56701431fb1e10
flags
:
0
RecentlyUsedScenePath-7
:
value
:
224247031146467c18070827072a4d1529360b39293c357f0e26113febf33d37ecd333faf3093c393707d06e372e093ae00f1a45e305031f08
flags
:
0
RecentlyUsedScenePath-8
:
value
:
224247031146467
f080c192534315e071f191f0f343c233e3e20123dadc52c39eff73aeca81f273d3412e3394a2b0f36e613
value
:
224247031146467
c18070827072a4d1529360b39293c357f0e26113febf33d37ecd333faf3093c393707d06e372e093ae00f1a34c6190306181af41814cc001b14d71d8b0fc61608d2
flags
:
0
RecentlyUsedScenePath-9
:
value
:
224247031146467c18070827072a4d1529360b39293c357f0e26113febf33d37ecd333faf3093c393707d06e372e093ae00f1a34
d51e191f1e03cd0701fa5e061fcc0cdc
value
:
224247031146467c18070827072a4d1529360b39293c357f0e26113febf33d37ecd333faf3093c393707d06e372e093ae00f1a34
c6190306181af41814d2150019f511d51f860a12c20d05
flags
:
0
vcSharedLogLevel
:
value
:
0d5e400f0650
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment