Skip to content

Commit

Permalink
Merge pull request #140 from ModiaSim/an_issue139
Browse files Browse the repository at this point in the history
changed functions according to issue #139
  • Loading branch information
GerhardHippmann authored Jan 31, 2024
2 parents 33856e3 + 372565f commit d7c935b
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/Composition/handler.jl
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ function revertJointInfo!(oldChild::Object3D{F}, newChild::Object3D{F}) where F
newChild.joint = oldChild.joint

# joint specific treatment
jointSpecificTreatment!(newChild, oldChild)
jointSpecificTreatment!(oldChild, newChild)

oldChild.hasChildJoint = oldChild.hasChildJoint || newChild.hasChildJoint

Expand Down
6 changes: 3 additions & 3 deletions src/Composition/joints/Revolute.jl
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,8 @@ end
Revolute(; kwargs...) = Revolute{Float64}(; kwargs...)


function revertRevoluteKind!(oldChild::Object3D{F}, newChild::Object3D{F}) where F <: Modia3D.VarFloatType
newChild.joint.obj1, newChild.joint.obj2 = newChild.joint.obj2, newChild.joint.obj1
newChild.joint.eAxis = -newChild.joint.eAxis
function revertRevoluteKind!(joint::Revolute{F}) where F <: Modia3D.VarFloatType
joint.obj1, joint.obj2 = joint.obj2, joint.obj1
joint.eAxis = -joint.eAxis
return nothing
end
3 changes: 2 additions & 1 deletion src/Composition/joints/joints.jl
Original file line number Diff line number Diff line change
Expand Up @@ -863,7 +863,8 @@ end

function jointSpecificTreatment!(oldChild::Object3D{F}, newChild::Object3D{F})::Nothing where F <: Modia3D.VarFloatType
if newChild.jointKind == Modia3D.Composition.RevoluteKind
revertRevoluteKind!(oldChild, newChild)
joint::Revolute{F} = newChild.joint
revertRevoluteKind!(joint)
return nothing
elseif newChild.jointKind == Modia3D.Composition.FixKind
# nothing needs to be done here
Expand Down

0 comments on commit d7c935b

Please sign in to comment.