[V8i MDL] understanding mdlKISolid_elementToBody2

Existing code uses mdlKISolid_elementToBody.  It converts an element, such as a shape, to a KIBODY and subsequently we create a mesh from that body, then analyse the facets of the mesh.  That has worked fine and continues to work fine with MicroStation V8i.

My problems start when I read the MDL documentation for mdlKISolid_elementToBody and find that it is deprecated in favour of mdlKISolid_elementToBody2.  The coordinates extracted by the subsequent mesh & facetting are wrong.  I guess I'm supposed to do something with the transform created by mdlKISolid_elementToBody2, but what?  My guesses so far have been wrong.

Parents
  • mdlKISolid_elementToBody will only return a valid body if the element to convert fits within a SWA sized box centered at 0,0,0. If the element is outside that area the behavior of downstream operations such as doing a boolean union is unpredicable.

    mdlKISolid_elementToBody2 differs from mdlKISolid_elementToBody in that instead of returning a body that has been translated/scaled to uor coordinates using mdlKISolid_applyTransform with the body to uor transform, it instead returns the body in it's local coordinate system along with the mdlcurrtrans scaled body to uor transform.

    You then have to use the body to uor transform to convert coordinates/distances between uors and solid kernel coordinates. HTH

    NOTE: In the next version of MicroStation there is a new C++ api for solids that will greatly simplify things. You'll only ever need to deal with uors for input and output, there isn't a special mdlcurrtrans that you need to setup, and operations like booleans automatically account for the different local coordinates systems of the target/tool bodies.

    -B



    Answer Verified By: Jon Summers 

Reply
  • mdlKISolid_elementToBody will only return a valid body if the element to convert fits within a SWA sized box centered at 0,0,0. If the element is outside that area the behavior of downstream operations such as doing a boolean union is unpredicable.

    mdlKISolid_elementToBody2 differs from mdlKISolid_elementToBody in that instead of returning a body that has been translated/scaled to uor coordinates using mdlKISolid_applyTransform with the body to uor transform, it instead returns the body in it's local coordinate system along with the mdlcurrtrans scaled body to uor transform.

    You then have to use the body to uor transform to convert coordinates/distances between uors and solid kernel coordinates. HTH

    NOTE: In the next version of MicroStation there is a new C++ api for solids that will greatly simplify things. You'll only ever need to deal with uors for input and output, there isn't a special mdlcurrtrans that you need to setup, and operations like booleans automatically account for the different local coordinates systems of the target/tool bodies.

    -B



    Answer Verified By: Jon Summers 

Children
No Data