Hi @colomon,
Doing this:
// Create a mesh
ON_Mesh mesh(4, 1, true, false);
// Add vertices
mesh.SetVertex(0, ON_3dPoint(0.0, 0.0, 0.0));
mesh.SetVertex(1, ON_3dPoint(10.0, 0.0, 0.0));
mesh.SetVertex(2, ON_3dPoint(10.0, 10.0, 0.0));
mesh.SetVertex(3, ON_3dPoint(0.0, 10.0, 0.0));
// Add face
mesh.SetQuad(0, 0, 1, 2, 3);
// Add ngon
ON_SimpleArray<unsigned int> ngon_fi;
ngon_fi.Append(0);
mesh.AddNgon(ngon_fi);
// ComputeNormals
mesh.ComputeVertexNormals();
// Finish up
mesh.Compact();
// Dump
ON_wString str;
ON_TextLog log(str);
mesh.Dump(log);
produces this:
ON_Mesh: vertex count = 4 facet count = 1
double precision: true
vertex normals: true
face normals: true
n-gons: true
srf parameters: false
tex coords: false
vertex kappa: false
vertex colors: false
m_Ctag:
Texture/color mapping tag:
ON_MappingTag::Unset
m_packed_tex_rotate: false
m_packed_tex_domain: (-1.23432e+308,-1.23432e+308)x(-1.23432e+308,-1.23432e+308)
m_srf_domain: (-1.23432e+308,-1.23432e+308)x(-1.23432e+308,-1.23432e+308)
m_srf_scale: 0,0
m_Ttag:
Texture/color mapping tag:
ON_MappingTag::Unset
Memory used: 140 bytes
4 mesh vertices:
m_V array hash ON_SHA1_Hash::3316F6091AF9DEFE54A4BC516B436DE9CA737231
m_dV array hash ON_SHA1_Hash::226D90143CB58B959A39997CAE484DF115E36E28
m_V[0] = (0,0,0) D = (0,0,0)
m_V[1] = (10,0,0) D = (10,0,0)
m_V[2] = (10,10,0) D = (10,10,0)
m_V[3] = (0,10,0) D = (0,10,0)
4 mesh vertex normals:
m_N array hash ON_SHA1_Hash::77E4AD5D3847C25F99C7BBC7CF07E5571A16F7DC
m_N[0] = (0,0,1)
m_N[1] = (0,0,1)
m_N[2] = (0,0,1)
m_N[3] = (0,0,1)
1 mesh faces:
m_F array hash ON_SHA1_Hash::02E4414E7DFA0F3AA2387EE8EA7AB31431CB406A
m_F[0].vi = (0,1,2,3)
1 mesh face normals:
m_FN[0] = (0,-0,1)
1 mesh n-gons:
Ngon(0): m_vi[4]=(0,1,2,3) m_fi[1]=(0) capacity=7 boundary counts outer = 4, inner = 0
What are we missing?
– Dale