Daniel,

I understand your method now. Here i am explaining what i had proposed a
little earlier.

Intermediate mesh:
struct polygonal_mesh {
int num_verts;
int num_faces;
double *vertices; //size- 3*num_verts
int *faces; //size - 3*num_faces
/* Other necessary attributes (normals, etc.) and other ones like mode,
thickness will also be present */
};

Converting BRL-CAD's rt_bot_internal to polygonal_mesh:

polygonal_mesh* convert_brlcad_to_intermediate(rt_bot_internal *bot) {
polygonal_mesh *mesh;

mesh->num_verts = bot->num_vertices;
mesh->num_faces = bot->num_faces;
/* All other attributes of polygonal_mesh can be given values in this way */
mesh->mode = bot->face_mode;

return mesh;
}

The same way, we can convert Polyset to the intermediate structure,
polygonal_mesh.
But now, since Polyset doesn't support things like face mode, and hence
thickness, etc, we set those to null.

polygonal_mesh* convert_openscad_to_intermediate(PolySet polyset_mesh) {
for(int i = 0; i < polyset_mesh.size(); i++) {
for(int j = 0; j < polgonal_mesh[i].size(); j++) {
/*set the vertices and then the faces */
}
}

mesh->mode = NULL;
mesh->thickness = 0;
}

So, this way out conversion just lies in these two functions and all the
mesh healing utility functions (like getting number of faces, getting a
face, functions related to modifying vertices, edges as well) can be
written just once.

I know we don't have much time left before i start coding it out, but just
thought i'd solidify my idea and let you know.
What do you think about this method? Or do you feel it'd be more robust
using the generic container and defining the conversion process separately
in the utility functions?

Also, i had another question. Since we won't be giving mode-specific
operations, will it give rise to any complications? For example, in vertex
contraction functionality, i had proposed that if the mode was plate/surf
the final vertex would be the midpoint of the two that are going to be
contracted. If it was a volume bot, then we'd take the midpoint of the line
formed by the intersection of the two tangential planes. How do we solve
this?

PS: For the conversion process, depending on the method we decide on, i'd
have to write the utility functions appropriately. I'll go through my
entire proposal once and make a list of all the functions i could possibly
need. Sure, we could add them later, but having something would complicate
things lesser, i feel. How about a week for all the base work relating to
conversions. If i finish earlier, i can just get on with the next thing. Or
should i allot lesser time? Is there anything else you think i should
change with my project plan?

Regards,
Rakshika.
------------------------------------------------------------------------------
Mobile security can be enabling, not merely restricting. Employees who
bring their own devices (BYOD) to work are irked by the imposition of MDM
restrictions. Mobile Device Manager Plus allows you to control only the
apps on BYO-devices by containerizing them, leaving personal data untouched!
https://ad.doubleclick.net/ddm/clk/304595813;131938128;j
_______________________________________________
BRL-CAD Developer mailing list
brlcad-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/brlcad-devel

Reply via email to