Skip to content

Commit 51d928d

Browse files
committed
removed no longer used and unused stuff for mass properties
1 parent c14e61c commit 51d928d

File tree

6 files changed

+3
-56
lines changed

6 files changed

+3
-56
lines changed

src/Composition/_module.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ Andrea Neumayr and Martin Otter, [DLR - Institute of System Dynamics and Control
2121
module Composition
2222

2323
export initialize, initAnalysis!, performAnalysis!, closeAnalysis!, visualize!, visualizeWorld!
24-
export updatePosition!, update!, driveJoint!
24+
export updatePosition!, update!
2525
export Object3D
2626
export RotationVariables, RCardan123
2727
export WStartVariables, WCartesian, WCardan123

src/Composition/massPropertiesComputation.jl

Lines changed: 1 addition & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -19,19 +19,7 @@ function initializeMassComputation!(scene::Scene)
1919
buffer = scene.buffer
2020
for i = 1:length(buffer)
2121
rootSuperObj = buffer[i]
22-
#=
23-
if featureHasMass(rootSuperObj) # feature of root object has already mass properties
24-
rootSuperObj.objectHasMass = true
25-
copyMassPropertiesFromFeatureToObject3D(rootSuperObj.massProperties, rootSuperObj.feature.massProperties.m,
26-
rootSuperObj.feature.massProperties.rCM, rootSuperObj.feature.massProperties.I)
27-
callInitialInertiaTensor!(rootSuperObj, superObjs[i].superObjMass.superObj)
28-
else # root obj's feature has no mass properties, but common mass super object do
29-
if length(superObjs[i].superObjMass.superObj) > 0
30-
rootSuperObj.objectHasMass = true
31-
callInitialInertiaTensor!(rootSuperObj, superObjs[i].superObjMass.superObj)
32-
end
33-
end
34-
=#
22+
3523
if featureHasMass(rootSuperObj) # feature of root object has already mass properties
3624
rootSuperObj.hasMass = true
3725
rootSuperObj.m = rootSuperObj.feature.massProperties.m
@@ -52,12 +40,10 @@ function initializeMassComputation!(scene::Scene)
5240
end
5341
end
5442

55-
# callInitialInertiaTensor! is called at initialization.
5643
# It loops over all objects of an actual mass super object.
5744
# It sums up common mass, inertia tensor and center of mass.
5845
# The results are stored twice in actual root of super object:
5946
# massProperties: container for actual values
60-
# function callInitialInertiaTensor!(rootSuperObj::Object3D, actualMassSuperObject::Vector{Object3D,1})
6147
function addMassPropertiesOfAllSuperObjChildsToRootSuperObj!(rootSuperObj::Object3D, actualMassSuperObject::Vector{Object3D})
6248
if length(actualMassSuperObject) > 0
6349
for i=1:length(actualMassSuperObject)
@@ -158,13 +144,3 @@ function addOrSubtractMassPropertiesOfChildToRoot!(obj_root, obj_child; add=true
158144
obj_root.I_CM = I
159145
return nothing
160146
end; end
161-
162-
163-
# helper function for assigning mass properties
164-
#=
165-
function assignMassProperties(massProperties, m, rCM, I)
166-
massProperties.m = m
167-
massProperties.rCM = rCM
168-
massProperties.I = I
169-
end
170-
=#

src/Composition/object3D.jl

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -539,12 +539,6 @@ function canCollide(obj::Object3D)::Bool
539539
end
540540

541541

542-
function driveJoint!(obj::Object3D)::Nothing
543-
obj.isDriven = true
544-
return nothing
545-
end
546-
547-
548542
""" rootObject3D(obj) - returns the root Object3D of all parents of obj"""
549543
function rootObject3D(obj::Object3D)::Object3D
550544
obj1 = obj

src/Composition/printObject3D.jl

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -63,15 +63,6 @@ function printScene(scene)
6363
println(" v = ", obj.joint.specific.v)
6464
println(" w = ", obj.joint.specific.w)
6565
end
66-
67-
hasMassProperties = scene.options.useOptimizedStructure && objectHasMass(obj) ||
68-
!scene.options.useOptimizedStructure && featureHasMass(obj)
69-
if hasMassProperties
70-
massProperties::Shapes.InternalMassProperties = scene.options.useOptimizedStructure ? obj.massProperties : obj.feature.massProperties
71-
println(" massProperties")
72-
println(" m = ", massProperties.m)
73-
println(" rCM = ", massProperties.rCM)
74-
end
7566
end
7667
println()
7768
end

src/Shapes/_module.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ export supportPoint_Sphere, supportPoint_Ellipsoid, supportPoint_Box, supportPoi
5757
export supportPoint_i_Box, supportPoint_i_Cylinder, supportPoint_i_Cone, supportPoint_i_Capsule,supportPoint_i_Beam, supportPoint_i_Ellipsoid, supportPoint_i_FileMesh
5858

5959
# Solid materials
60-
export InternalMassProperties, MassProperties, SolidMaterial, ContactMaterialElastic, dummyMassProperties
60+
export MassProperties, SolidMaterial, ContactMaterialElastic
6161

6262
export MassPropertiesFromShape, MassPropertiesFromShapeAndMass
6363

src/Shapes/massProperties.jl

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -67,21 +67,7 @@ MassProperties(shape::Modia3D.AbstractGeometry, material::SolidMaterial) =
6767
MassProperties(shape::Modia3D.AbstractGeometry, materialName::AbstractString) =
6868
MassProperties(shape, solidMaterialPalette[materialName])
6969

70-
# structure InternalMassProperties is only for internal purposes
71-
mutable struct InternalMassProperties <: Modia3D.AbstractMassProperties
72-
m::Float64 # mass in [kg]
73-
rCM::Frames.Vector3D # center of mass in [m]
74-
I::SMatrix{3,3,Float64,9} # inertia matrix in [kg.m^2]
75-
76-
InternalMassProperties() = new(0.0, Modia3D.ZeroVector3D,
77-
SMatrix{3,3,Float64,9}(0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0))
78-
end
79-
8070

81-
#=
82-
getMassProperties(massProperties::Union{Modia3D.AbstractMassProperties, Number, AbstractString, SolidMaterial, Nothing},
83-
shape::Modia3D.AbstractGeometry, solidMaterial::Union{AbstractString,SolidMaterial,Nothing}) = createMassProperties(massProperties, shape, solidMaterial)
84-
=#
8571
createMassProperties(massProperties::MassProperties, shape, solidMaterial) = massProperties
8672

8773
createMassProperties(massProperties::Union{Number, SolidMaterial, AbstractString}, shape::Modia3D.AbstractGeometry, solidMaterial) = MassProperties(shape, massProperties)

0 commit comments

Comments
 (0)