Skip to content
This repository has been archived by the owner on Nov 22, 2023. It is now read-only.

Quad Faces are incorrectly converted to Triangle Faces #169

Open
sjkelly opened this issue Apr 7, 2019 · 2 comments
Open

Quad Faces are incorrectly converted to Triangle Faces #169

sjkelly opened this issue Apr 7, 2019 · 2 comments

Comments

@sjkelly
Copy link
Member

sjkelly commented Apr 7, 2019

I ran into this while working on meshing.

This is the simplest example:

julia> fcs4 = Face{4,Int}(1,2,3,4)
4-element Face{4,Int64}:
 1
 2
 3
 4

julia> convert(Face{3,Int},fcs4)
3-element Face{3,Int64}:
 1
 2
 3

When converting from Quads to Triangles this should return a tuple of Face{3,Int}(1,2,3),Face{3,Int}(3,4,1)

It is possible I am not calling the conversion correctly. It is these lines here: https://github.com/JuliaGeometry/Meshing.jl/pull/20/files#diff-bf57842023cb186f77b74657fbbe3164R224

@rdeits
Copy link
Contributor

rdeits commented Apr 7, 2019

I think this convert call should just be an error. Looks like a bug in the FixedSizeArrays compatibility layer, which we should be getting rid of (see #156 ).

However, I think the function you actually want is decompose:

julia> f4 = Face{4, Int}(1,2,3,4)
4-element Face{4,Int64}:
 1
 2
 3
 4

julia> decompose(Face{3, Int}, f4)
([1, 2, 3], [1, 3, 4])

@sjkelly
Copy link
Member Author

sjkelly commented Apr 8, 2019

I forgot about the decompose functionality. Maybe we need to call it (with some array work) instead of convert here:

convert(Vector{FaceT}, faces),

The quad mesh to triangle mesh conversion is the symptom here. I'll be playing with #27 and #166 shortly, so I will try to address then.

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

No branches or pull requests

2 participants