Minor changes
This commit is contained in:
parent
0af38855a4
commit
a9d926302e
|
@ -79,12 +79,15 @@ public:
|
||||||
int i_idx = p1.X()-_bbox.min.X();
|
int i_idx = p1.X()-_bbox.min.X();
|
||||||
int k_idx = p2.Z()-_bbox.min.Z();
|
int k_idx = p2.Z()-_bbox.min.Z();
|
||||||
int index = i_idx+k_idx*_resolution.X();
|
int index = i_idx+k_idx*_resolution.X();
|
||||||
if (p1.X()!=p2.X()) //intersezione della superficie con un Xedge
|
if (p1.X()!=p2.X()) //intersezione della superficie con un Xedge
|
||||||
return (p1.Y()==_current_slice)? _x_cs[index]!=-1 : _x_ns[index]!=-1;
|
return (p1.Y()==_current_slice)? _x_cs[index]!=-1 : _x_ns[index]!=-1;
|
||||||
else if (p1.Y()!=p2.Y()) //intersezione della superficie con un Yedge
|
else if (p1.Y()!=p2.Y()) //intersezione della superficie con un Yedge
|
||||||
return _y_cs[index]!=-1;
|
return _y_cs[index]!=-1;
|
||||||
else if (p1.Z()!=p2.Z()) //intersezione della superficie con un Zedge
|
else if (p1.Z()!=p2.Z()) //intersezione della superficie con un Zedge
|
||||||
return (p1.Y()==_current_slice)? _z_cs[index]!=-1 : _z_ns[index]!=-1;
|
return (p1.Y()==_current_slice)? _z_cs[index]!=-1 : _z_ns[index]!=-1;
|
||||||
|
|
||||||
|
assert(false); // impossibile: i due punti non erano allineati rispetto a nessuna direzione
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
void GetXIntercept(const vcg::Point3i &p1, const vcg::Point3i &p2, VertexPointer &v)
|
void GetXIntercept(const vcg::Point3i &p1, const vcg::Point3i &p2, VertexPointer &v)
|
||||||
|
|
|
@ -19,11 +19,11 @@
|
||||||
<Tool
|
<Tool
|
||||||
Name="VCCLCompilerTool"
|
Name="VCCLCompilerTool"
|
||||||
Optimization="0"
|
Optimization="0"
|
||||||
AdditionalIncludeDirectories="c:\Libraries\vcg\"
|
AdditionalIncludeDirectories=".\..\..\..\..\"
|
||||||
PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
|
PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
|
||||||
MinimalRebuild="TRUE"
|
MinimalRebuild="TRUE"
|
||||||
BasicRuntimeChecks="3"
|
BasicRuntimeChecks="3"
|
||||||
RuntimeLibrary="5"
|
RuntimeLibrary="3"
|
||||||
UsePrecompiledHeader="0"
|
UsePrecompiledHeader="0"
|
||||||
WarningLevel="3"
|
WarningLevel="3"
|
||||||
Detect64BitPortabilityProblems="TRUE"
|
Detect64BitPortabilityProblems="TRUE"
|
||||||
|
@ -67,9 +67,9 @@
|
||||||
CharacterSet="2">
|
CharacterSet="2">
|
||||||
<Tool
|
<Tool
|
||||||
Name="VCCLCompilerTool"
|
Name="VCCLCompilerTool"
|
||||||
AdditionalIncludeDirectories="c:\Libraries\vcg"
|
AdditionalIncludeDirectories=".\..\..\..\..\"
|
||||||
PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
|
PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
|
||||||
RuntimeLibrary="4"
|
RuntimeLibrary="2"
|
||||||
UsePrecompiledHeader="0"
|
UsePrecompiledHeader="0"
|
||||||
WarningLevel="3"
|
WarningLevel="3"
|
||||||
Detect64BitPortabilityProblems="TRUE"
|
Detect64BitPortabilityProblems="TRUE"
|
||||||
|
|
|
@ -21,13 +21,17 @@ int main(int argc, char *argv[])
|
||||||
|
|
||||||
// MARCHING CUBES
|
// MARCHING CUBES
|
||||||
Mesh mc_mesh;
|
Mesh mc_mesh;
|
||||||
|
printf("[MARCHING CUBES] Building mesh...");
|
||||||
MarchingCubes mc(mc_mesh, walker);
|
MarchingCubes mc(mc_mesh, walker);
|
||||||
walker.BuildMesh<MarchingCubes>(mc_mesh, volume, mc);
|
walker.BuildMesh<MarchingCubes>(mc_mesh, volume, mc);
|
||||||
vcg::tri::io::ExporterPLY<Mesh>::Save( mc_mesh, "marching_cubes.ply");
|
vcg::tri::io::ExporterPLY<Mesh>::Save( mc_mesh, "marching_cubes.ply");
|
||||||
|
printf("OK!\n");
|
||||||
|
|
||||||
// EXTENDED MARCHING CUBES
|
// EXTENDED MARCHING CUBES
|
||||||
Mesh emc_mesh;
|
Mesh emc_mesh;
|
||||||
|
printf("[EXTENDED MARCHING CUBES] Building mesh...");
|
||||||
ExtendedMarchingCubes emc(emc_mesh, walker, 30);
|
ExtendedMarchingCubes emc(emc_mesh, walker, 30);
|
||||||
walker.BuildMesh<ExtendedMarchingCubes>(emc_mesh, volume, emc);
|
walker.BuildMesh<ExtendedMarchingCubes>(emc_mesh, volume, emc);
|
||||||
vcg::tri::io::ExporterPLY<Mesh>::Save( emc_mesh, "extended_marching_cubes.ply");
|
vcg::tri::io::ExporterPLY<Mesh>::Save( emc_mesh, "extended_marching_cubes.ply");
|
||||||
|
printf("OK!\n");
|
||||||
};
|
};
|
Binary file not shown.
Binary file not shown.
Loading…
Reference in New Issue