Hi all,
I have a slab which is a box, i want to get the faces of the box? the box is as below, the dng file is attached,
I am runing Microstation CE 10.7, programming with C++ and C#, I try to run below code to get the face data,
with above box(only one element), the facecount is 3, dose that means the box has 3 faces? what i would expect is 6 faces. and the face index count is 48, i am not sure what this face index is for?
and how i can get the face data, I need to get the triangle points on each face(not for the whole box, which i can get now), I just need to know the facet data for each face, means how the face is represented by
triangle faces(the points coordinate, normals , uvs....)
BentleyStatus ElementGraphicsProcessor::_ProcessFacets(PolyfaceQueryCR facets, bool isFilled){ // This block code is try to get the face data from the polyface { auto isIndexed = facets.IsVariableSizeIndexed(); auto faceCount = facets.GetFaceCount(); auto faceIndexCount = facets.GetFaceIndexCount(); FacetFaceDataCP faceData = facets.GetFaceDataCP(); bvector<int> pIndices; bvector<DPoint3d> pXYZ; int pNumIndexPerFace; int pNumFace; MSElementDescrCP elementDescr = m_eh.GetElementDescrCP(); auto result = mdlMesh_getPolyfaceArrays(elementDescr, &pIndices, &pXYZ, &pNumIndexPerFace, &pNumFace); }
texture.dgn
thanks,
Rick
The slab in your dgn is a Type 19 solid of extrusion (i.e. a capped surface). This is a lightweight/legacy type that has no notion of topology such as faces, edges, and vertices.
For the purposes of PolyfaceQuery::GetFaceCount, the entire lateral surface generated from all segments of the swept linestring is considered a "face". The other 2 faces are the start cap and end cap. See illustration below.
The term "face" in this case is clearly not intended to be the more traditional meaning of "face" such as you would encounter with a boundary representation solid defined by face, edge, vertex topology, connectivity information, and attached geometry.
So, you are asking for something that does not exist for this type of element. The uv parameterization of the "lateral" face is based on the swept linestring, that's what you have to work with. What is it exactly you are trying to accomplish?
-B
Answer Verified By: Rick cheng
thanks for the reply, and since during the last weeks I am on vacation, and just get back, what i want to do is to get the uvs and texture of the faces, and so i can use this uvs and texture to rebuild the model in my system, i just want to export the dgn model to an OpenCTM model, where i have issue with the texture. by the way, I now can get three faces, the start, end caps and the lateral face, but i am not able to get the texture correctly. even for the cap faces, the texture is not correct when import to an OpenCTM model.
Rick cheng said:i am not able to get the texture correctly
What's going wrong (it's hard to know without seeing your code)? Use the Materials API to harvest information about textures.
That Material API is substantially improved over the C-style mdlMaterial_api in earlier versions of MicroStation. I've seen no questions about it on this Forum, so you're exploring new territory.
Regards, Jon Summers LA Solutions