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

Mesh with tris and quads? #142

Open
RibeiroAndre opened this issue Mar 27, 2021 · 6 comments
Open

Mesh with tris and quads? #142

RibeiroAndre opened this issue Mar 27, 2021 · 6 comments

Comments

@RibeiroAndre
Copy link

Hi!
Any way to create a mesh of mixed element types? I don't see any way of mixing tris and quads in the same mesh.
Thanks a lot!

@juliohm
Copy link
Member

juliohm commented Mar 27, 2021 via email

@RibeiroAndre
Copy link
Author

Thanks for the quick answer.
Would the meshes from Meshes.jl be compatible with Makie?
Thanks!

@juliohm
Copy link
Member

juliohm commented Mar 27, 2021 via email

@RibeiroAndre
Copy link
Author

Ok, thanks!

@SimonDanisch
Copy link
Member

There is an overload missing to create the correct polytope type:

using GeometryBasics
using GeometryBasics: AbstractNgonFace, AbstractPoint, Ngon
function GeometryBasics.Polytope(P::Type{<:AbstractPoint{Dim,T}},
                  ::Type{<:AbstractNgonFace{N,IT} where N}) where {Dim,T,IT}
    return Ngon{Dim,T,N,P} where N
end

f = [TriangleFace(1, 2, 3), QuadFace(1, 2, 3, 4)]

p = Point2f0[(0, 1), (1, 2), (3, 4), (4, 5)]
Mesh(p, x);

There seem to be some more overloads missing for when there are faces with different Ns, so display errors as well...

@BambOoxX
Copy link

BambOoxX commented Mar 2, 2022

Hi @SimonDanisch , I just stumbled upon this very issue, is there a plan to implement a correction for this issue ?

I also tried your fix (just correcting x by f in Mesh(p,x) and it shows no error as long as the output is omitted with ; as you proposed.
However, if i remove the trailing ; an exception occurs

ERROR: MethodError: no method matching (Ngon{2, Float32, N, Point{2, Float32}} where N)(::QuadFace{Point{2, Float32}})

I'm working with

  • GeometryBasics v0.4.1
  • Julia v1.7.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants