Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Scientific Software
vEXP
Commits
cceb77c7
Commit
cceb77c7
authored
Mar 25, 2022
by
legoc
Browse files
Corrected trajectories in energy
parent
8824772b
Changes
2
Hide whitespace changes
Inline
Side-by-side
js/client/utils/shapes/energy-line.js
View file @
cceb77c7
...
...
@@ -151,13 +151,18 @@ class EnergyLine extends TrajectoryLine {
// Calculate length of the segment. Applies the scale.
let
length
=
this
.
_end
.
clone
().
sub
(
this
.
_start
).
length
()
*
this
.
getEnergyScale
();
// Create a line segment for the line.
let
segment
=
new
LineSegment
(
new
THREE
.
Vector3
(
0
,
0
,
0
),
new
THREE
.
Vector3
(
0
,
0
,
length
),
0.5
/
scale
,
this
.
_lineMaterial
);
this
.
_line
=
segment
;
if
(
length
>
0
)
{
// It is necessary not to draw line with length 0 because the underlying cylinder has a default length 1.
this
.
_line
=
new
LineSegment
(
new
THREE
.
Vector3
(
0
,
0
,
0
),
new
THREE
.
Vector3
(
0
,
0
,
length
),
0.5
/
scale
,
this
.
_lineMaterial
);
// Add the line to the data group.
this
.
_dataGroup
.
add
(
this
.
_line
.
object3D
);
// Add the line to the data group.
this
.
_dataGroup
.
add
(
this
.
_line
.
object3D
);
}
else
{
this
.
_line
=
null
;
}
}
// Update the data.
...
...
@@ -189,6 +194,7 @@ class EnergyLine extends TrajectoryLine {
this
.
_line
.
object3D
.
visible
=
visibility
;
}
this
.
_dataGroup
.
visible
=
visibility
;
this
.
_pointSphereGroup
.
visible
=
visibility
;
}
/**
...
...
js/client/views/3D/reciprocal/trajectory-view.js
View file @
cceb77c7
...
...
@@ -104,12 +104,8 @@ class TrajectoryView3D extends View3D {
this
.
_energyLine
.
start
=
energyStart
;
this
.
_energyLine
.
end
=
energyStart
;
// Show energy line for ki and kf trajectories.
if
(
this
.
_type
===
'
ki
'
||
this
.
_type
===
'
kf
'
)
{
this
.
_energyLine
.
setVisibility
(
true
);
}
this
.
_energyLine
.
setVisibility
(
true
);
this
.
_drawLines
=
true
;
}
else
{
...
...
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