03-02-2011 03:02 AM - edited 03-02-2011 03:12 AM
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
03-04-2011 06:34 AM
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__BOOLA
Another API which may be useful removing sliver faces is api_replace_face_with_tedge (see http://doc.spatial.com/qref/ACIS/html/group__BOOLA
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.
03-04-2011 07:31 AM - edited 03-04-2011 07:33 AM
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 ?
03-04-2011 08:21 AM
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
SPAposition corner_position = corner_vertex->geometry()->coords();
From there, you can find the coordinates for that position on the yellow face by
// assume you have calculated FACE* yellow_face
SPAposition foot; // this will be calculated by point_perp.
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__BOOLA
hope this helps
03-04-2011 06:06 PM - edited 03-04-2011 06:11 PM
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?
03-04-2011 07:55 PM
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
good luck to you.