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

changed functions according to issue #139 #140

Merged
merged 2 commits into from
Jan 31, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading