Home
Reply
dxw
Contributor
dxw
Posts: 11

Problem of removing sliver faces

[ Edited ]

I'm not sure if it is exactly right to describe the faces as sliver ones. Yet they are quite the same. Screenshots

are as follows(the top one is the whole model while the other two are partly magnified of the red-line-circled part of

the whole model).   Shapes of two sides of the part are cylinder and plane.

 

It has troubled me much that what I shall do to get rid of the red-line-circled part of the entity. Though it is

so small to be seen without being magnified,tough problems can occur sometimes.

 

To remove the sheet part,function 'api_detect_sliver_faces' makes no effect,as the returned number of sliver_faces

is 0.

whole model.jpg
partly magnified.jpg
partly magnified2.jpg
dxw
Contributor
dxw
Posts: 11

Re: Problem of removing sliver faces

Can anyone help me please? Any advice or suggestion is welcome.
Spatial Employee
asdf
Posts: 106

Re: Problem of removing sliver faces

Dear dxw

 

The API you used api_detect_sliver_faces is a good first thing to try.  It has some limitations in terms of topology.  

 

If the face you want to remove is on the edge of a sheet body, you might just want to unhook and delete it.The api to use for that is api_unhook_face (or api_unhook_faces).  In the scheme toolkit, this is the "face:unhook" command.  Please see http://doc.spatial.com/qref/ACIS/html/group__BOOLADVREMOVALS.html#gcece16e190fa697eb24be9a3acd7a32c for more information on that API.

 

Another API which may be useful removing sliver faces is api_replace_face_with_tedge (see http://doc.spatial.com/qref/ACIS/html/group__BOOLADVCHECKSREPAIRS.html#g4d0ef5c4032b904b7fc1d52c98e5... for documentation on this).

 

If both suggestions apply, the first is probably better (you shouldn't have a tedge on the boundary of a sheet).  The problem of detecting and fixing up tedges is a bit difficult.  Please let me know if these suggestions do not help, so I can look for something else.

 

best regards

 

Eric

 

dxw
Contributor
dxw
Posts: 11

Re: Problem of removing sliver faces

[ Edited ]

Hi,Eric! Thanks for your kindness!

 

 In picture2 and 3,the red-line-circled part(in picture1) seems to be a sliver face. Yet,this is not true. In fact,the circled part,which is also the yellow part in picture2, is a sheet body  with both faces visible when being magnified. One side of the circled part is plane and the other is a cylinder one. May be the sheet part is formed by some certain Boolean operation.

 

Now I just want to remove the circled part, as it is so small and also not needed,but can cause problems when I take the model to do other things.

 

Maybe I can describe it more clearly that in the three pictures, there is just one body, the circled sheet (but not a single face) is part of the body. Then I can't delete the sheet part with function 'api_unhook_face' or 'api_replace_face_with_tedge',right ?

 

Sincelely yours

dxw

Spatial Employee
asdf
Posts: 106

Re: Problem of removing sliver faces

Dear dxw

 

To clarify: api_unhook_faces takes any list of faces you want and removes them from a body.  The API api_replace_face_with_tedge will take a face with one loop of three or 4 edges and remove it, filling the remaining gap with a tedge.

 

I think what you are saying is that you only want to remove part of the yellow face in the picture: is that correct?

 

In this case, you may want to split the face into two pieces, one you want to keep and one to remove.  For that you might use a boolean subtract with a small block to remove that section of face.  Alternatively, you could split the face at the parameter of the corner vertex of the blue face.  You can find the position of the corner vertex using 

 

#include "vertex.hxx"

#include "apoint.hxx"

#include "position.hxx"

 

SPAposition corner_position = corner_vertex->geometry()->coords();

 

From there, you can find the coordinates for that position on the yellow face by

 

#include "face.hxx"

#include "surface.hxx"

#include "surdef.hxx"

 

// assume you have calculated  FACE* yellow_face

SPAposition foot; // this will be calculated by point_perp.

SPApar_pos foot_uv;

yellow_face->geometry()->equation().point_perp( corner_position, foot,*(SPApar_pos *) NULL_REF, foot_uv);

 

Once you have the uv (on the yellow face) of the corner of the blue face, you can split the yellow face at that u and at that v to cut the yellow face in to two pieces one which matches with the blue face and one that sticks out using api_split_face (see http://doc.spatial.com/qref/ACIS/html/group__BOOLADVSPLITS.html#g4ac83c8dc2d6267c2dbfd1a376abdada).

 

hope this helps

 

Eric

dxw
Contributor
dxw
Posts: 11

Re: Problem of removing sliver faces

[ Edited ]

 

Thanks, Eric !

 

From your detailed description, the way to solve the problem becomes clearer in my mind.

 

To remove the yellow face, there is another question that how I can get pointer of the yellow face. Maybe I can analyze the body carefully and then get it. The fact is a little complex. The big plane shown in the pictures is just one of a model, and there are other bodies in the model. So it won't be convient to remove the yellow face by hand. I want to realize that by PC. That's to say: the computer software checks the model,find the ill entities and then deleted them.

 

In a word and come to this problem, considering  its characters, can the yellow face be detected automatically?

 

 

dxw

Spatial Employee
asdf
Posts: 106

Re: Problem of removing sliver faces

A ray fire -- using api_ray_fire -- (or graphical pick using the rendering system) is how I would do it in the scheme toolkit.  A ray fire basically looks at all the geometry that intersects a linesegment.  To visualise a scene like you have with the attached picture, the graphics system has an eye position and a target.  Your mouse position gives another   point.  I think most applications fire rays along the line from the eye position to the mouse position.

 

Automatically removing slivers is tough.  A basic problem is that the threshhold for whe topology becomes sliver topology varies with what you are trying to do.  The other problem is what you want to have left after you remove the undesirable face.  Is it ok to leave a tolerance edge, or a hole, or do you want to seal things back up after removing the sliver?

 

I should also mention another API for removing faces of a model: api_remove_facess.  This is different from unhooking a face, because unhooking a face leaves a gap in the solid.  api_remove_faces removes a face, then tries to fill the gap by intersecting

surrounding faces.

 

good luck to you.

 

Eric

dxw
Contributor
dxw
Posts: 11

Re: Problem of removing sliver faces

 

Troubled you much. Thanks!

 

Just as what you said, there is more  I shall take into consideration.

 

 

Best regards!

 

dxw