Closed juliohm closed 6 months ago
How should we define the general torus? A possibility is major radius + minor radius + center + equatorial plane.
It sounds like a good parameterization. I've seen definitions in terms of rotations, but they are too abstract for most applications. Happy to review a PR for this one too.
Or maybe major radius + minor radius + center + axis of revolution (the normal to the equatorial plane). I think it's more convenient to give a vector than a plane.
Good point. center + normal + major + minor would be a nice order of fields in the struct.
As discussed on Zulip, it would be nice to also have a Tube primitive ππ½
And the Cone
.
For the torus passing through three given points, I have to do a function computing the circumcircle of three points in the 3D space. I'm wondering whether this function could be useful for something else. You're not interested in 3D curves?
For the torus passing through three given points, I have to do a function computing the circumcircle of three points in the 3D space. I'm wondering whether this function could be useful for something else. You're not interested in 3D curves?
Definitely useful. We are interested in 3D curves too, and already support them btw. BezierCurve is n-dimensional in our code right? What exactly is missing? A new constructor for the Sphere?
There's a 2D sphere implemented, that is a circle, but it doesn't live in the 3D space. To define a 3D circle I need its center, its radius, and the normal to the plane it belongs to.
Our Sphere is n-dimensional. Please double check which constructor is missing and feel free to submit a PR ππ½
But a 3D sphere is not a 3D circle. I don't understand.
Oh I see what you tried to say now. Our Sphere{3} is a 3D sphere embedded in 3D space. We don't have a 2D sphere embedded in 3D currently. Maybe it is time to add a Circle primitive? I wonder if we can generalize Sphere to accommodate this use case.
I've added two new primitives to our checklist: Disk
and Circle
.
Our Ball
and Sphere
generalizations are defined in terms of a Dim
-dimensional center and a radius. In this case, it is assumed that the parametric dimension is a function of the embedding dimension, namely: paramdim(Ball{Dim}) = Dim
and paramdim(Sphere{Dim}) = Dim-1
.
The new Disk
and Circle
primitives on the other hand would always be 2D and 1D primitives embedded in 3D space, defined in terms of a Plane
and a radius. This gives us the flexibility to place rotated disks in a 3D scene and the ability to define Cone
and ConeSurface
.
I've added Disk
and Circle
as described above. Now we are ready to add Cone
and ConeSurface
.
I've added Cone
and ConeSurface
as described above. Now we are only missing Torus
and Tube
.
@stla please let me know when you are back online to work on the Torus PR: https://github.com/JuliaGeometry/Meshes.jl/pull/364 ππ½
@stla now the only missing primitive from our original list of primitives is the Tube. Would you like to add it?
Where should I put the code for the Frenet frames? In the root file primitives.jl?
Maybe we should add a new source file frames.jl to store this concept.
@msfch I've added the Prism geometry to the TODO list. Feel free to start a PR :)
PR for the Prism is at #404
I also have added a Hyperplane type in my own code. This is different from the existing Plane type, which always has a parametric dimension of 2, and instead has a parametric dimension of Dimβ1. In 3D they are the same, of course, but I still had some use for a geometry that has an internal representation of point+normal rather than point+vectors (or point+point in 2D, which is what Line uses). Maybe the Hyperplane is worth considering as well?
The Ellipsoid is another type worth considering. As it is a pretty fundamental type when it comes to representations of the Earth, it might be useful to take some inspiration from JuliaGeo packages such as Geodesy.jl, but since those ellipsoids are symmetric around the rotational axis they canβt be used as-is. One aspect that might be interesting is Earth ellipsoids often use the inverse flattening rather as second parameter than the second half-axis to make it easier to represent near-spherical shapes with limited-precision numbers β not sure if that is applicable to the scope of Meshes.jl though.
Thank you @mfsch, added to the list.
Hello. I'm back π
Here is some stuff to make a mesh of a closed tubular path. For example a knot:
One can choose the number of sides. Here I take 4 sides but we don't correctly see them because the mesh is smoothed:
One can also twist the tube. But again we don't see because of the smoothing.
The method is taken from this blog post.
Welcome back @stla ! The list of missing geometries is on the top of this issue. Feel free to pick one and submit a PR. Also, regarding the smoothing option, please feel free to submit a PR to the code in ext
to add options to the Makie.jl calls.
Hey. I'm not familiar with Makie. I have no idea how it deals with the normals.
I wanted to show you a twisted tube (two twists) with four sides and without normals, done in R with the same method:
This really works well. As you can see the sides are not smooth. I took 500 points. In Julia this is very fast so we can take more and the mesh would look smoother.
Ideally we should do four meshes, one for each side and add the normals to each of these meshes. In this way the sides would be smooth but flat, and the angles would remain visible.
What is the status of the ellipse code?
No one working on it currently.
Em sex., 8 de dez. de 2023 08:27, prittjam @.***> escreveu:
What is the status of the ellipse code?
β Reply to this email directly, view it on GitHub https://github.com/JuliaGeometry/Meshes.jl/issues/349#issuecomment-1847007271, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAZQW3O4F2BLNR4DJOXW4STYIL2QNAVCNFSM6AAAAAATHFVT5GVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQNBXGAYDOMRXGE . You are receiving this because you authored the thread.Message ID: @.***>
Added Ellipsoid
. Closing the issue in favor of future issues with specific geometry requests.
Issue to track our efforts adding more primitives.