Home
Reply
dom
Visitor
dom
Posts: 2

How to modify a solid BODY by stretching its vertices

Hi all,

I'm new to ACIS, I'm trying to solve the following problem:

I am developing an application using the Open Design Alliance DWGdirect libraries, working on AutoCAD files.

My user should be able to modify a 3dSolid entity by stretching its vertices.

 

I'm using the following procedure:

 

  1. export the 3dSolid entity from DWGdirect to ACIS format in a binary (memory) file;
  2. import from the file using api_restore_entity_list_file;
  3. modify the appropriate vertices using VERTEX::set_geometry;
  4. export the resulting BODY in a binary (memory) file using api_save_entity_list_file;
  5. import from the file back to DWGdirect;

This procedure seemed to work in wireframe view mode, but when switching to shaded view mode, it was evident that the faces of the BODY were not recalculated correctly (see attached pictures: Solid1.gif = original body; Solid2.gif = two vertices stretched (wireframe); Solid3.gif = same as Solid2.gif (flat shaded)).

 

I tried also an alternative approach, replacing step 3 of the above procedure with the following:

 

3 (alternative). create a new empty solid BODY pBody2, then call api_make_wire(pBody2,...) for each loop in each face of the original BODY, and finally call api_cover_wires(pBody2, NULL).

 

The resulting body had correct faces, but its internal structure was completely scrambled in a number of new lumps and shells (while the original body had only one lump and shell); any subsequent trial to stretch the resulting body caused the lost of most parts of it.

 

So which is the correct procedure for modifying an existing body given its new vertex positions or, alternatively, which is the correct way of creating a new body given vertices and loops?

 

(Sorry for the length of my question)

 

Thank you,

Domenico.

 

Solid1.gif
Solid2.gif
Solid3.gif
Spatial Moderator
Brendan
Posts: 89

Re: How to modify a solid BODY by stretching its vertices

Perhaps the easiest way to modify a solid is to use the Local Operations component.  In your case, I would use api_tweak_faces (http://doc.spatial.com/index.php/Tweak_Faces) to replace the two rectangular side faces of your body (the faces with two blue and two red vertices).  If you supply new surfaces for these two side faces to the tweak operation, all the other geometry of the body will be appropriately updated.

 

Brendan

dom
Visitor
dom
Posts: 2

Re: How to modify a solid BODY by stretching its vertices

Hi Brendan,

thanks for your prompt reply. As I mentioned in my first post, I am new to ACIS so I have some trouble in providing a surface to the tweak api. I've got to study some geometry at least. Moreover, I don't know how to replace a face with a new one in an existing body.

 

However, in the meantime I found a solution using the alternative procedure (create a new BODY by calling api_make_wire and api_cover_wires: it didn't work before because I missed a final call to api_stitch in order to glue all together).

 

Best regards,

Domenico.

 

Spatial Moderator
ybiyani
Posts: 222

Re: How to modify a solid BODY by stretching its vertices

Hello Domenico,

 

If you are new to ACIS please consider contacting your Account Manager for a consultative traning session- that is the best way to learn about our products.

 

Regards,

Yogesh

Spatial Moderator
rbagley
Posts: 123

Re: How to modify a solid BODY by stretching its vertices

If I may suggest: you are thinking in wireframe, but ACIS is structured to "think" in solids.

 

The face in your example is not defined by the vertices, rather the vertices lie on the face.  To modify shape in ACIS you should be thinking about changing, moving, or redefining the solid or surface geometry -- not the edge or vertex geometry.

 

Hopefully this paradigm will help you better understand and navigate ACIS.  You can probably accomplish your goal in the "wireframe" way you have started, but I think it will be easier using solid-modeling tools.

 

Best regards,

Ray