Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
R
Rational Linkages
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Custom issue tracker
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
geometrie-vermessung
Rational Linkages
Merge requests
!68
update from dev
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
update from dev
dev_to_nightly
into
future_nightly
Overview
0
Commits
69
Pipelines
6
Changes
1
Merged
Daniel Huczala
requested to merge
dev_to_nightly
into
future_nightly
5 months ago
Overview
0
Commits
69
Pipelines
6
Changes
1
Expand
0
0
Merge request reports
Viewing commit
6fcede72
Prev
Next
Show latest version
1 file
+
32
−
0
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
6fcede72
update
· 6fcede72
daniel_hucik
authored
5 months ago
python/rational_linkages/RationalMechanism.py
+
32
−
0
Options
@@ -79,6 +79,8 @@ class RationalMechanism(RationalCurve):
self
.
_segments
=
None
self
.
_metric
=
None
@property
def
segments
(
self
):
"""
@@ -1287,3 +1289,33 @@ class RationalMechanism(RationalCurve):
# Save the stacked array to a CSV file
np
.
savetxt
(
'
trajectory.csv
'
,
data
,
delimiter
=
'
,
'
,
fmt
=
'
%1.6f
'
)
def
update_metric
(
self
):
"""
Update the metric of the mechanism.
Set to none so that the metric is recalculated when needed.
"""
self
.
_metric
=
None
def
update_segments
(
self
):
"""
Update the line segments of the linkage.
"""
self
.
_segments
=
self
.
_get_line_segments_of_linkage
()
def
get_relative_motions
(
self
):
"""
Get the relative motions of the mechanism.
"""
sequence
=
DualQuaternion
()
branch0
=
[
sequence
:
=
sequence
*
factor
for
factor
in
self
.
factorizations
[
0
].
factors_with_parameter
]
sequence
=
DualQuaternion
()
branch1
=
[
sequence
:
=
sequence
*
factor
for
factor
in
self
.
factorizations
[
1
].
factors_with_parameter
]
relative_motions
=
branch0
+
branch1
[::
-
1
]
return
relative_motions
Loading