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

Add boundary for all Primitive geometries #210

Closed
8 tasks done
juliohm opened this issue Nov 16, 2021 · 13 comments
Closed
8 tasks done

Add boundary for all Primitive geometries #210

juliohm opened this issue Nov 16, 2021 · 13 comments
Labels
feature good first issue Good for newcomers

Comments

@juliohm
Copy link
Member

juliohm commented Nov 16, 2021

Given a primitive geometry, we should be able to construct its boundary mesh (or geometry). For example, the boundary of a Ball is a Sphere. The boundary of a Cylinder is a SimpleMesh with two disks and the wall of the cylinder. We can already sample these geometries using our sampling methods, we just need to connect the dots to return a mesh.

  • Box
  • Ball
  • Sphere
  • Line
  • Ray
  • Plane
  • Cylinder
  • BezierCurve
@juliohm juliohm added good first issue Good for newcomers feature labels Nov 16, 2021
@HaoxuanGuo
Copy link
Contributor

So, what is the method name? Use the SimpleMesh construction method? As we know, some geometry has many different represent of mesh. For example, sphere has UV sphere, ico sphere, quad sphere and Goldberg polyhedra. How to choose that?

@juliohm
Copy link
Member Author

juliohm commented Nov 19, 2021 via email

@HaoxuanGuo
Copy link
Contributor

@juliohm For Cylinder the number of faces of the wall (Or the number of the edges of the disks) is not exactly as well. In another word, we may require some other parameters to generate the boundary. What about using a kw args?

@juliohm
Copy link
Member Author

juliohm commented Nov 19, 2021 via email

@juliohm
Copy link
Member Author

juliohm commented Dec 4, 2021

I've implemented a couple of different discretization methods. Now we can discretize the sphere with quadrangles + triangles using any sampling size:

sphere = Sphere((0.,0.,0.), 1.)

mesh = discretize(sphere, RegularDiscretization(100))

viz(mesh, showfacets = true)

image

and we can pass this polygonal mesh to triangulate to create a triangle mesh:

tmesh = triangulate(mesh)

viz(tmesh, showfacets = true)

image

I will polish the Makie recipes now to hide these internals so that end users can simply viz(sphere).

@HaoxuanGuo
Copy link
Contributor

Line and Ray has a infinite volume. Are these boundary exist?

@juliohm
Copy link
Member Author

juliohm commented Dec 4, 2021 via email

@HaoxuanGuo
Copy link
Contributor

@juliohm Sounds great.

@juliohm
Copy link
Member Author

juliohm commented Dec 4, 2021

Ok, just registered a patch release where the following works:

viz(sphere, color = :orange)

image

@juliohm
Copy link
Member Author

juliohm commented Dec 4, 2021

Now we are only missing the boundary of Cylinder which is a cylindrical surface plus two disks and the boundary of BezierCurve. In the first case we need a new struct to represent the cylindrical surface, like we do with Ball -> Sphere. In the last case we can return the two end points as a PointSet.

Let me know if you want to work on that @HaoxuanGuo 👍🏽

@HaoxuanGuo
Copy link
Contributor

@juliohm I am not familiar on the topologic of mesh. But I would like to have a try.

@juliohm
Copy link
Member Author

juliohm commented Dec 5, 2021

@HaoxuanGuo I will work on the cylinder case now, it should be ready by the end of the day. If you can help with the BezierCurve to add a boundary and maybe review the recipe in MeshViz.jl that would be great.

@juliohm
Copy link
Member Author

juliohm commented Dec 5, 2021

Now all primitives have boundary. I did refactor the solid Cylinder type and also introduced a new CylinderSurface type. We need to review these primitives in the future and try to use more constructive geometry to avoid code repetition.

@juliohm juliohm closed this as completed Dec 5, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

2 participants