Hi
I'm using MicroStation V8i (Select series 3) v08.11.09.459 and programming language MDL.
I'm having trouble adding a Solid (a torus in this example) to an element descriptor. I'm using the code below and as seen on the image, the torus is placed correctly and added to the cell, but when rendered in Smooth mode, it looks horrible.
How can I make this look like it's supposed to?
As you can see in the image, the Solid torus is converted to a Surface containing 11 Arcs. Maybe that's the problem, but I don't know how to avoid that?
My code looks something like this. First is a function to create the torus - returned in an MSElementDescr**
void Tool_elementCreateTorus( MSElementDescr **descr, double radius1, double radius2, double angle )
{
KIBODY *body;
mdlKISolid_body( &body );
mdlKISolid_makeTorus(
&body, //KIBODY** bodyPP ,
radius1, //double primaryRadius ,
radius2, //double secondaryRadius,
angle //double angle
);
mdlKISolid_bodyToElements(
descr, //MSElementDescr** edPP,
body, //KIBODY* bodyP,
FALSE, //BoolInt wireframe, // FALSE looks horrible in smooth mode :-(
-1, //int nIsoParametrics,
NULL, //MSElement* templateP,
ACTIVEMODEL //DgnModelRefP modelRef
);
mdlKISolid_freeBody( body );
}
and later on the function is called like this:
MSElementDescr *descr, *torus;
Tool_elementCreateTorus( &torus, 0.045, 0.010, 180 );
mdlTMatrix_getIdentity( &tMatrix );
mdlTMatrix_translate( &tMatrix, &tMatrix, 0.0, 0.045, 0 );
mdlElmdscr_transform( torus, &tMatrix );
// (the descr is initialized as a new elementdescriptor and filled with a lot of other
// elements as well before this is called)
mdlElmdscr_appendDscr( descr, torus );
// ...and in the end the resulting descr is added to file.
Any help would be much appreciated - thank you.
/Jorgen