Home
Reply
Regular Contributor
bheld
Posts: 41

Merging 2 3D cells does not remove unnecessary edges

We are using the technique mentioned here (but in C++):

 

http://doc.spatial.com/index.php/HowTo:Merge_two_3D_Cells

 

After we call api_remove_face on the common face(s), the number of cells is what we would expect, but edges remain that I would have expected to be removed per the api_remove_face documentation.  The simple case there 2 boxes overlap demonstrates this.

 

Any ideas?

 

 

Contributor
Sarvnaz
Posts: 25

Re: Merging 2 3D cells does not remove unnecessary edges

Hello,

 Would it be possible for you to attach an image of the issue you are experiencing. Specifically showing the edges remained that you expected to be removed.

 

Thanks

Regular Contributor
bheld
Posts: 41

Re: Merging 2 3D cells does not remove unnecessary edges

Here you go.  The first one (capture.jpg) show the 2 overlapping boxes.  Capture2.jpg shows what I want it to look like after the cell merging.  Capture3.jpg shows what it does look like.

 

I basically want it to look the same as if it did if I unioned the boxes, but for a variety of reasons I can't use a regular boolean.

Capture.JPG
Capture2.JPG
Capture3.JPG
Regular Contributor
bheld
Posts: 41

Re: Merging 2 3D cells does not remove unnecessary edges

Anyone???

Spatial Moderator
ybiyani
Posts: 223

Re: Merging 2 3D cells does not remove unnecessary edges

Here is the modified scheme example from the FAQ. Is this what you are looking for?

 

(part:clear)
(view:face-normals #t)
(define b (solid:block (position 0 0 0) (position 20 5 5)))
(define t (solid:block (position 0 0 5) (position 5 5 20)))
(iso)
(zoom-all)
(bool:nonreg-unite b t)
(cell:attach b)
(define cells (entity:cells b))
(define num_cells_before (length cells))
(test:equal num_cells_before 2 "Incorrect cells")
 
(define faces_cell1 (entity:faces (list-ref cells 0)))
(define faces_cell2 (entity:faces (list-ref cells 1)))
 
;;Get the common face from the above lists.
(define common_face (list-ref faces_cell1 5))
(test:equal common_face (list-ref faces_cell2 0) "Not a common face")
 
;;Remove common face.
(face:remove common_face)
 
;;There is one 3D cell after merge
(define num_cells_after (length (entity:cells b)) )
(test:equal num_cells_after 1 "3D cells did not merge")

(bool:merge b)

 

The last call to bool:merge will remove the scar edges. bool:merge implements api_clean_entity (http://doc.spatial.com/qref/ACIS/html/group__BOOLADVMERGE.html#g86f182c6d800fe1f0c81cbadbeb41c18)

 

 

Regards,

Yogesh

Regular Contributor
bheld
Posts: 41

Re: Merging 2 3D cells does not remove unnecessary edges

Yogesh,

 

That works great!  Thanks.

 

When api_clean_entity removes edges and vertices, what, if anything, happens to attributes on the associated faces/edges?  Can I assume they follow the typical actions defined when the attributes are added?

 

Thanks,

Be

Regular Contributor
bheld
Posts: 41

Re: Merging 2 3D cells does not remove unnecessary edges

Hi Yogesh,

 

Is there a fast way to remove a lot of faces from a body?  I have a case where I need to remove > 10000 faces and calling api_remove_face takes a long time (> 10 minutes).  I've tried api_remove_faces (preceeded by a call to api_initialize_face_removal), but this doesn't reduce the number of cells in my CT model. 

 

Thanks,

Ben

Spatial Moderator
rbagley
Posts: 120

Re: Merging 2 3D cells does not remove unnecessary edges

Ben,

 

When you say "remove faces", what end result are you looking for? Api_remove_face does a lot of expensive geometric work to close up the solid body after removing a face or faces.  If you just want to take faces away and leave an open solid, then use api_unhook_face or api_unhook_faces followed by deleting the unhooked entities.

 

If you really do want the operation of api_remove_face -- preserving the integrity of the solid body -- then you can get some improvement by removing multiple connected faces at once.  10,000 faces is a lot to be removing - what sort of models are they?

 

Best,

Ray Bagley

Regular Contributor
bheld
Posts: 41

Re: Merging 2 3D cells does not remove unnecessary edges

Hi Ray,

 

 I need to keep the solid body closed up.  Basically we are trying to merge a bunch of 3D Cells together (http://doc.spatial.com/index.php/HowTo:Merge_two_3D_Cells).  These are very complex circuit board type geometries.  In one example, I'm merging 907 cells into 61 cells so maybe it's not 10,000 faces but this process takes 10 minutes on a very fast overclocked machine.  It's dominating our overall processing (which involves many non-reg unions earlier in the process).

 

You indicate that I may see some improvement by removing multiple connected faces at once.  How can I try this out?  As I mentioned api_remove_faces didn't work.

 

Ben