Skip to content

Commit

Permalink
Change subdiv from global to cut face, this makes the final result fa…
Browse files Browse the repository at this point in the history
…r much better
  • Loading branch information
huxingyi committed Apr 16, 2018
1 parent e9d0696 commit a201d09
Show file tree
Hide file tree
Showing 7 changed files with 7 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/meshgenerator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,10 @@ void MeshGenerator::process()
bool isDisabled = isTrueValueString(disabledString);
if (isDisabled)
continue;
bool subdived = isTrueValueString(valueOfKeyInMapOrEmpty(part->second, "subdived"));
int bmeshId = meshlite_bmesh_create(meshliteContext);
if (subdived)
meshlite_bmesh_set_cut_subdiv_count(meshliteContext, bmeshId, 1);
if (MeshGenerator::enableDebug)
meshlite_bmesh_enable_debug(meshliteContext, bmeshId, 1);
partBmeshMap[partIdIt] = bmeshId;
Expand Down Expand Up @@ -220,7 +223,8 @@ void MeshGenerator::process()
zMirroredMeshId = meshlite_mirror_in_z(meshliteContext, meshId, 0);
}
}
bool subdived = isTrueValueString(valueOfKeyInMapOrEmpty(part->second, "subdived"));
//bool subdived = isTrueValueString(valueOfKeyInMapOrEmpty(part->second, "subdived"));
bool subdived = false;
if (m_requirePartPreviewMap.find(partIdIt) != m_requirePartPreviewMap.end()) {
ModelOfflineRender *render = m_partPreviewRenderMap[partIdIt];
int trimedMeshId = meshlite_trim(meshliteContext, meshId, 1);
Expand Down
Binary file modified thirdparty/meshlite/meshlite_unstable_vc14_x64/meshlite.dll
Binary file not shown.
Binary file modified thirdparty/meshlite/meshlite_unstable_vc14_x64/meshlite.dll.lib
Binary file not shown.
1 change: 1 addition & 0 deletions thirdparty/meshlite/meshlite_unstable_vc14_x64/meshlite.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ int meshlite_get_halfedge_index_array(void *context, int mesh_id, int *buffer, i
int meshlite_get_halfedge_normal_array(void *context, int mesh_id, float *buffer, int max_buffer_len);
int meshlite_build(void *context, float *vertex_position_buffer, int vertex_count, int *face_index_buffer, int face_index_buffer_len);
int meshlite_bmesh_create(void *context);
int meshlite_bmesh_set_cut_subdiv_count(void *context, int bmesh_id, int subdiv_count);
int meshlite_bmesh_enable_debug(void *context, int bmesh_id, int enable);
int meshlite_bmesh_add_node(void *context, int bmesh_id, float x, float y, float z, float radius);
int meshlite_bmesh_add_edge(void *context, int bmesh_id, int first_node_id, int second_node_id);
Expand Down
Binary file modified thirdparty/meshlite/meshlite_unstable_vc14_x86/meshlite.dll
Binary file not shown.
Binary file modified thirdparty/meshlite/meshlite_unstable_vc14_x86/meshlite.dll.lib
Binary file not shown.
1 change: 1 addition & 0 deletions thirdparty/meshlite/meshlite_unstable_vc14_x86/meshlite.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ int meshlite_get_halfedge_index_array(void *context, int mesh_id, int *buffer, i
int meshlite_get_halfedge_normal_array(void *context, int mesh_id, float *buffer, int max_buffer_len);
int meshlite_build(void *context, float *vertex_position_buffer, int vertex_count, int *face_index_buffer, int face_index_buffer_len);
int meshlite_bmesh_create(void *context);
int meshlite_bmesh_set_cut_subdiv_count(void *context, int bmesh_id, int subdiv_count);
int meshlite_bmesh_enable_debug(void *context, int bmesh_id, int enable);
int meshlite_bmesh_add_node(void *context, int bmesh_id, float x, float y, float z, float radius);
int meshlite_bmesh_add_edge(void *context, int bmesh_id, int first_node_id, int second_node_id);
Expand Down

0 comments on commit a201d09

Please sign in to comment.