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 operation with wedge to ease the representation of the topology of core mesh, with wedges to handle attribs. #589

Draft
wants to merge 37 commits into
base: release-candidate
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
aada215
[core] save topological mesh current status as deprecated.
dlyr Mar 17, 2021
43e8ec8
[core] clean deprecated code that refer new version.
dlyr Mar 17, 2021
c06df4d
[core] Remove unneeded lines.
dlyr Feb 23, 2021
9be1425
[core] Add update from/to TriangleMesh and update wedge normals.
dlyr Feb 23, 2021
952d77b
[core] Fix Topo updates and optimizing, sort of.
dlyr Feb 26, 2021
2581405
[core] Topo store normal index, use direct acces to wedge data.
dlyr Feb 26, 2021
1c442bc
[core] Topo: move template specialization to the top.
dlyr Feb 26, 2021
0877bbf
[core] Topo/Core mesh "fast" updates.
dlyr Feb 26, 2021
f117a69
[core] Topo/Core mesh updates: switch to vector when possible.
dlyr Feb 26, 2021
ecc8bde
[core] Topo: make conversion from PolyMesh (wedges only).
dlyr Mar 17, 2021
7396c61
[tests] Topo: make conversion from PolyMesh (wedges only).
dlyr Mar 17, 2021
d8758a5
[tests] Remove deprecated topo tests.
dlyr Jul 17, 2020
1ae0187
[core] huge remove of deprecated, need to update tests.
dlyr Mar 17, 2021
964e9c2
[core] Topo: Wedge modifier.
dlyr Mar 17, 2021
f1b3b5f
[core] Make topo ctor templated by index type (tri/poly).
dlyr Mar 17, 2021
13f1086
[core] Topo reorganize declarations (hpp/inl).
dlyr Feb 27, 2021
edf8fbf
[core] remove deprecated unused using decl.
dlyr Feb 27, 2021
b5de901
[core] rename addProp to addAttrib form wedge collection.
dlyr Feb 27, 2021
e5d96a0
[core] rename setWedgeData to setWedgeAttrib to set one attrib.
dlyr Feb 27, 2021
be82741
[core] more deprecation, is "mostly" handled by wedges,
dlyr Feb 27, 2021
7d7e161
[core] topo remove omp parallel for (windows error)
dlyr Feb 27, 2021
1816741
[core] topo add newWedge function and some aliases.
dlyr Mar 1, 2021
a7161c8
[core] topo improve newWedgeData.
dlyr Mar 2, 2021
2825c78
[tests] call splitEdge instead of alias splitEdgeWedge.
dlyr Mar 17, 2021
0a620c0
[core] More checks in topo integrity.
dlyr Mar 7, 2021
f24e7d8
[core] Add topo triangulate fixup.
dlyr Mar 7, 2021
47d0b99
[core] Topo to line Mesh.
dlyr Mar 5, 2021
7e52f7e
[core] fix topo wedge collapse
dlyr Mar 11, 2021
df3f087
[core] fix mergeEqualWedge for boundaries.
dlyr Mar 13, 2021
f36f6e3
[core] rename addWedgeData to addWedgeAttrib, when one attrib only.
dlyr Mar 15, 2021
4c930bc
[core] clean and add deprecated.
dlyr Mar 16, 2021
b479e8f
[tests] wip topo merge unit test
dlyr Mar 12, 2021
2bff2b6
[tests] update topo collapse unittest.
dlyr Mar 16, 2021
8b2c7ac
[tests] Draw primitive triangulate, and remove degen faces.
dlyr Mar 7, 2021
3a988b9
[tests] draw prim wedge collapse
dlyr Mar 12, 2021
2589dce
[tests] DrawPrimitives more examples of collapse.
dlyr Mar 13, 2021
4a1be9c
[tests] Update DrawPrimitive for collapse.
dlyr Mar 16, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions cmake/filelistCore.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ set( core_sources
Geometry/Adjacency.cpp
Geometry/Area.cpp
Geometry/CatmullClarkSubdivider.cpp
Geometry/deprecated/TopologicalMesh.cpp
Geometry/HeatDiffusion.cpp
Geometry/Laplacian.cpp
Geometry/LoopSubdivider.cpp
Expand Down Expand Up @@ -91,6 +92,7 @@ set( core_headers
Geometry/Area.hpp
Geometry/CatmullClarkSubdivider.hpp
Geometry/Curve2D.hpp
Geometry/deprecated/TopologicalMesh.hpp
Geometry/DistanceQueries.hpp
Geometry/Frustum.hpp
Geometry/HeatDiffusion.hpp
Expand Down Expand Up @@ -154,6 +156,7 @@ set( core_inlines
Containers/Grid.inl
Containers/Tex.inl
Geometry/Curve2D.inl
Geometry/deprecated/TopologicalMesh.inl
Geometry/DistanceQueries.inl
Geometry/MeshPrimitives.inl
Geometry/PolyLine.inl
Expand Down
28 changes: 12 additions & 16 deletions src/Core/Geometry/CatmullClarkSubdivider.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@ bool CatmullClarkSubdivider::prepare( TopologicalMesh& mesh ) {
mesh.add_property( m_epH );
mesh.add_property( m_fpH );
mesh.add_property( m_creaseWeights );
mesh.createAllPropsOnFaces(
m_normalPropF, m_floatPropsF, m_vec2PropsF, m_vec3PropsF, m_vec4PropsF );
///\todo mesh.createAllPropsOnFaces( m_normalPropF );
mesh.add_property( m_hV );
for ( uint i = 0; i < mesh.n_halfedges(); ++i )
{
Expand All @@ -30,7 +29,7 @@ bool CatmullClarkSubdivider::cleanup( TopologicalMesh& mesh ) {
mesh.remove_property( m_epH );
mesh.remove_property( m_fpH );
mesh.remove_property( m_creaseWeights );
mesh.clearAllProps( m_normalPropF, m_floatPropsF, m_vec2PropsF, m_vec3PropsF, m_vec4PropsF );
///\todo mesh.clearAllProps( m_normalPropF );
mesh.remove_property( m_hV );
return true;
}
Expand Down Expand Up @@ -78,8 +77,7 @@ bool CatmullClarkSubdivider::subdivide( TopologicalMesh& mesh,
#pragma omp critical
{ m_newFaceVertexOps[iter].push_back( V_OPS( vh, ops ) ); }
// deal with properties
mesh.interpolateAllPropsOnFaces(
fh, m_normalPropF, m_floatPropsF, m_vec2PropsF, m_vec3PropsF, m_vec4PropsF );
///\todo mesh.interpolateAllPropsOnFaces( fh, m_normalPropF );
}

// Compute position for new (edge-) vertices and store them in the edge property
Expand Down Expand Up @@ -166,8 +164,8 @@ bool CatmullClarkSubdivider::subdivide( TopologicalMesh& mesh,
mesh.set_next_halfedge_handle( heh6, heh2 );

// deal with properties
mesh.copyAllProps( heh3, heh5 );
mesh.copyAllProps( heh1, heh6 );
///\todo mesh.copyAllProps( heh3, heh5 );
///\todo mesh.copyAllProps( heh1, heh6 );
m_triangulationPropOps.push_back( {heh5, {{1, heh3}}} );
m_triangulationPropOps.push_back( {heh6, {{1, heh1}}} );
}
Expand Down Expand Up @@ -200,14 +198,13 @@ void CatmullClarkSubdivider::split_face( TopologicalMesh& mesh,
mesh.set_face_handle( hold, fh );

// deal with properties for vh
mesh.copyAllPropsFromFace(
fh, hold, m_normalPropF, m_floatPropsF, m_vec2PropsF, m_vec3PropsF, m_vec4PropsF );
///\todo mesh.copyAllPropsFromFace( fh, hold, m_normalPropF );

// go around new vertex to build topology
hold = mesh.opposite_halfedge_handle( hold );

// deal with properties for hold
mesh.copyAllProps( hend, hold );
///\todo mesh.copyAllProps( hend, hold );
m_newFacePropOps[iter].push_back( {hold, {{1, hend}}} );

const Scalar inv_val = Scalar( 1 ) / valence;
Expand All @@ -231,16 +228,15 @@ void CatmullClarkSubdivider::split_face( TopologicalMesh& mesh,
mesh.set_next_halfedge_handle( hold, hh );

// deal with properties for hnew
mesh.copyAllPropsFromFace(
fh, hnew, m_normalPropF, m_floatPropsF, m_vec2PropsF, m_vec3PropsF, m_vec4PropsF );
///\todo mesh.copyAllPropsFromFace( fh, hnew, m_normalPropF );

// prepare for next face
hh = mesh.next_halfedge_handle( hnext );
hold = mesh.opposite_halfedge_handle( hnew );
mesh.set_next_halfedge_handle( hnext, hnew ); // this has to be done after hh !

// deal with properties for hold
mesh.copyAllProps( hnext, hold );
///\todo mesh.copyAllProps( hnext, hold );
m_newFacePropOps[iter].push_back( {hold, {{1, hnext}}} );
p_ops[i] = {inv_val, hh};
}
Expand Down Expand Up @@ -310,7 +306,7 @@ void CatmullClarkSubdivider::split_edge( TopologicalMesh& mesh,
mesh.set_halfedge_handle( mesh.face_handle( opp_new_heh ), opp_new_heh );

// deal with custom properties
mesh.interpolateAllProps( t_heh, opp_heh, opp_new_heh, 0.5 );
///\todo mesh.interpolateAllProps( t_heh, opp_heh, opp_new_heh, 0.5 );
m_newEdgePropOps[iter].push_back( {opp_new_heh, {{0.5, t_heh}, {0.5, opp_heh}}} );
}

Expand All @@ -320,10 +316,10 @@ void CatmullClarkSubdivider::split_edge( TopologicalMesh& mesh,
mesh.set_halfedge_handle( mesh.face_handle( heh ), heh );

// deal with custom properties
mesh.copyAllProps( heh, new_heh );
///\todo mesh.copyAllProps( heh, new_heh );
m_newEdgePropOps[iter].push_back( {new_heh, {{1, heh}}} );
HeHandle heh_prev = mesh.prev_halfedge_handle( heh );
mesh.interpolateAllProps( heh_prev, new_heh, heh, 0.5 );
///\todo mesh.interpolateAllProps( heh_prev, new_heh, heh, 0.5 );
m_newEdgePropOps[iter].push_back( {heh, {{0.5, heh_prev}, {0.5, new_heh}}} );
}

Expand Down
12 changes: 7 additions & 5 deletions src/Core/Geometry/LoopSubdivider.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -183,8 +183,8 @@ void LoopSubdivider::corner_cutting( TopologicalMesh& mesh,
mesh.set_halfedge_handle( fh_new, heh1 );

// deal with custom properties
mesh.copyAllProps( heh1, heh4 );
mesh.copyAllProps( heh5, heh3 );
///\todo mesh.copyAllProps( heh1, heh4 );
///\todo mesh.copyAllProps( heh5, heh3 );
m_newFacePropOps[iter].push_back( {heh4, {{1, heh1}}} );
m_newFacePropOps[iter].push_back( {heh3, {{1, heh5}}} );
}
Expand Down Expand Up @@ -237,7 +237,9 @@ void LoopSubdivider::split_edge( TopologicalMesh& mesh,
mesh.set_halfedge_handle( mesh.face_handle( opp_new_heh ), opp_new_heh );

// deal with custom properties
mesh.interpolateAllProps( t_heh, opp_heh, opp_new_heh, 0.5 );

/// \todo
// mesh.interpolateAllProps( t_heh, opp_heh, opp_new_heh, 0.5 );
m_newEdgePropOps[iter].push_back( {opp_new_heh, {{0.5, t_heh}, {0.5, opp_heh}}} );
}

Expand All @@ -247,10 +249,10 @@ void LoopSubdivider::split_edge( TopologicalMesh& mesh,
mesh.set_halfedge_handle( mesh.face_handle( heh ), heh );

// deal with custom properties
mesh.copyAllProps( heh, new_heh );
/// \todo mesh.copyAllProps( heh, new_heh );
m_newEdgePropOps[iter].push_back( {new_heh, {{1, heh}}} );
HeHandle heh_prev = mesh.prev_halfedge_handle( heh );
mesh.interpolateAllProps( heh_prev, new_heh, heh, 0.5 );
/// \todo mesh.interpolateAllProps( heh_prev, new_heh, heh, 0.5 );
m_newEdgePropOps[iter].push_back( {heh, {{0.5, heh_prev}, {0.5, new_heh}}} );
}

Expand Down
Loading