-
Notifications
You must be signed in to change notification settings - Fork 30
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #161 from yt-project/sph-diagram-interactive
[ci skip] This build is based on 04a9eb7. This commit was created by the following CI build and job: https://github.com/yt-project/yt-4.0-paper/commit/04a9eb7f09be21b07f86135f0e4c4d0df51749ed/checks https://github.com/yt-project/yt-4.0-paper/actions/runs/6947153996
- Loading branch information
1 parent
18f9284
commit e089d20
Showing
67 changed files
with
56,521 additions
and
35 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
var particles = [ | ||
{ cx:65, cy:135, r:50}, | ||
{ cx:150, cy:175, r:35 }, | ||
{ cx:185, cy:130, r:7}, | ||
{ cx:160, cy:115, r:10}, | ||
{ cx:235, cy:90, r:40}, | ||
{ cx:215, cy:30, r:20}, | ||
{ cx:425, cy:45, r:40}, | ||
{ cx:280, cy:140, r:25 }, | ||
{ cx:350, cy:125, r:20 }, | ||
{ cx:410, cy:150, r:30}, | ||
{ cx:330, cy:180, r:35}, | ||
{ cx:255, cy:315, r:55}, | ||
{ cx:475, cy:240, r:60}, | ||
{ cx:650, cy:215, r:85}, | ||
{ cx:570, cy:45, r:45}, | ||
{ cx:705, cy:45, r:35}, | ||
]; | ||
const hitOptions = { | ||
segments: true, | ||
stroke: true, | ||
fill: true, | ||
tolerance: 5 | ||
}; | ||
function recalculateIntersections() { | ||
for (const particle of particleGroup.children) { | ||
if (rayLine.intersects(particle)) { | ||
particle.fillColor.gradient.stops = ['red','white']; | ||
particle.data.line.lastSegment.point = rayLine.getNearestPoint(particle.position); | ||
particle.data.line.strokeColor = 'black'; | ||
} else { | ||
particle.fillColor.gradient.stops = ['black', 'white']; | ||
particle.data.line.strokeColor = null; | ||
} | ||
} | ||
} | ||
|
||
const particleGroup = new Group(); | ||
|
||
for (i = 0; i< particles.length; i++) { | ||
const particle = particles[i]; | ||
var myCircle = new Path.Circle(new Point(particle.cx, particle.cy), particle.r); | ||
myCircle.data.line = new Path.Line(myCircle.position, myCircle.position + new Point(0, particle.r)) | ||
myCircle.data.line.strokeWidth = 3; | ||
myCircle.data.radius = particle.r; | ||
myCircle.fillColor = { | ||
gradient: { | ||
stops: ['black', 'white'], | ||
radial: true}, | ||
|
||
origin: myCircle.position, | ||
destination: myCircle.bounds.rightCenter | ||
}; | ||
particleGroup.addChild(myCircle); | ||
} | ||
|
||
const rayPoints = [new Point(50, 50), new Point(200, 50)]; | ||
const rayLine = new Path.Line(rayPoints[0], rayPoints[1]); | ||
const rayStart = new Path.Circle(rayPoints[0], 8); | ||
const rayStop = new Path.Circle(rayPoints[1], 8); | ||
rayLine.strokeColor = 'darkgray'; | ||
rayLine.strokeWidth = 3; | ||
rayStart.fillColor = 'red'; | ||
rayStop.fillColor = 'red'; | ||
|
||
function dragCircle(event) { | ||
event.target.position += event.delta; | ||
rayLine.firstSegment.point = rayStart.position; | ||
rayLine.lastSegment.point = rayStop.position; | ||
recalculateIntersections(); | ||
} | ||
|
||
rayStart.onMouseDrag = rayStop.onMouseDrag = dragCircle; | ||
|
||
function dragLine(event) { | ||
event.target.position += event.delta; | ||
rayStart.position = rayLine.firstSegment.point; | ||
rayStop.position = rayLine.lastSegment.point; | ||
recalculateIntersections(); | ||
} | ||
rayLine.onMouseDrag = dragLine; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Binary file added
BIN
+53 KB
v/04a9eb7f09be21b07f86135f0e4c4d0df51749ed/images/bitmap/collisions.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+137 KB
v/04a9eb7f09be21b07f86135f0e4c4d0df51749ed/images/bitmap/selector1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+151 KB
v/04a9eb7f09be21b07f86135f0e4c4d0df51749ed/images/bitmap/selector4.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+164 KB
v/04a9eb7f09be21b07f86135f0e4c4d0df51749ed/images/bitmap/selector5.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+99.6 KB
v/04a9eb7f09be21b07f86135f0e4c4d0df51749ed/images/bitmap/vary_decomp_to0.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+71.6 KB
v/04a9eb7f09be21b07f86135f0e4c4d0df51749ed/images/bitmap/vary_order1_or0.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+61.4 KB
v/04a9eb7f09be21b07f86135f0e4c4d0df51749ed/images/bitmap/vary_order2_to6.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+46.3 KB
v/04a9eb7f09be21b07f86135f0e4c4d0df51749ed/images/bitmap/vary_selector.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+579 Bytes
v/04a9eb7f09be21b07f86135f0e4c4d0df51749ed/images/colormaps/algae.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+612 Bytes
v/04a9eb7f09be21b07f86135f0e4c4d0df51749ed/images/colormaps/apricity.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+657 Bytes
v/04a9eb7f09be21b07f86135f0e4c4d0df51749ed/images/colormaps/arbre.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+632 Bytes
v/04a9eb7f09be21b07f86135f0e4c4d0df51749ed/images/colormaps/dusk.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+595 Bytes
v/04a9eb7f09be21b07f86135f0e4c4d0df51749ed/images/colormaps/kelp.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+628 Bytes
v/04a9eb7f09be21b07f86135f0e4c4d0df51749ed/images/colormaps/octarine.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+746 Bytes
v/04a9eb7f09be21b07f86135f0e4c4d0df51749ed/images/colormaps/pastel.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+475 Bytes
v/04a9eb7f09be21b07f86135f0e4c4d0df51749ed/images/colormaps/pixel_blue.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+397 Bytes
v/04a9eb7f09be21b07f86135f0e4c4d0df51749ed/images/colormaps/pixel_green.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+475 Bytes
v/04a9eb7f09be21b07f86135f0e4c4d0df51749ed/images/colormaps/pixel_red.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+509 Bytes
v/04a9eb7f09be21b07f86135f0e4c4d0df51749ed/images/colormaps/xray.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.
Oops, something went wrong.