Remove Faces with Sheet Edges

From DocR21

Jump to: navigation, search

Remove Faces cannot be generally applied on faces that contain free (sheet) edges. However, there are a couple of exceptions when it is possible to remove faces with free edges. If the faces being removed are blends, then the remove operation is allowed. The other exception is when the free edges of the faces that are being removed form an internal hole (gap), then in such a case, the remove operation is allowed.

Contents

Examples

Example 1

The following example illustrates a remove operation on blend faces that have sheet edges.

;;
;; Create a solid block
(define block (solid:block (position -20 -20 -20) (position 20 20 20)))
;; block
;; Create blend-chain on three of the edges
(ray:queue 24.594 -71.0721 45.3937 -0.408248 0.816497 -0.408248 1)
(ray:queue 43.8217 -62.157 43.9964 -0.408248 0.816497 -0.408248 1)
(ray:queue 42.8973 -65.8917 37.4513 -0.408248 0.816497 -0.408248 1)
(define bl_edges (list (pick-edge)(pick-edge)(pick-edge)))
;; bl_edges
(blend:const-rad-on-edge bl_edges 10 'fix)
;; (#[entity 2 1] #[entity 3 1] #[entity 4 1])
(blend:fix (car bl_edges))
;; #t
;; Convert the solid body into a sheet body
(ray:queue -51.3159 36.5947 -62.4519 0.683168 -0.499625 0.532594 1)
(entity:delete (face:unhook (pick-face)))
;; ()
(ray:queue -65.1713 39.7183 -41.7492 0.683168 -0.499625 0.532594 1)
(entity:delete (face:unhook (pick-face)))
;; ()
(ray:queue -49.9663 60.4734 -41.7826 0.683168 -0.499625 0.532594 1)
(entity:delete (face:unhook (pick-face)))
;; ()
;; Select all the blend faces for removal
(ray:queue 32.9715 -59.8284 55.5989 -0.536527 0.628375 -0.56328 1)
(ray:queue 46.9967 -55.3611 47.2234 -0.536527 0.628375 -0.56328 1)
(ray:queue 53.6321 -44.7832 52.7036 -0.536527 0.628375 -0.56328 1)
(ray:queue 53.5691 -57.4585 38.6234 -0.536527 0.628375 -0.56328 1)
(define face_list (list (pick-face)(pick-face)(pick-face)(pick-face)))
;; face_list
;; Remove the blend faces
(rem:remove-faces face_list)
Red Faces Are Being Removed
Result After Remove

Example 2

This example shows a remove operation on faces that contain free edges which form an internal gap.

(part:clear)
(define b (solid:block (position -2 -2 -2) (position 2 2 2)))
(define c (solid:cylinder (position 0 0 -1) (position 0 0 3) 0.5))
(define body (bool:unite b c))
 
(blend:const-rad-on-edge (list-ref (entity:edges body) 1) 0.5)
(blend:fix (list-ref (entity:edges body) 1))
 
(define faces (entity:faces body))
 
(entity:delete (face:unhook (list-ref faces 3)))
(entity:delete (face:unhook (list-ref faces 4)))
(entity:delete (face:unhook (list-ref faces 5)))
(entity:delete (face:unhook (list-ref faces 6)))
(entity:delete (face:unhook (list-ref faces 7)))
(entity:delete (face:unhook (list-ref faces 8)))
 
(define face_list (list (list-ref faces 0) (list-ref faces 1)))
(rem:remove-faces face_list)
Red Faces Are Being Removed
Result After Remove

Example 3

The example below demonstrates a case where the remove operation is invalid because the free edges of the faces to be removed do not form an internal gap.

(part:clear)
(define b (solid:block (position -2 -2 -2) (position 2 2 2)))
(define c (solid:cylinder (position 0 0 -1) (position 0 0 3) 0.5))
(define body (bool:unite b c))
 
(blend:const-rad-on-edge (list-ref (entity:edges body) 1) 0.5)
(blend:fix (list-ref (entity:edges body) 1))
 
(define c (solid:cylinder (position 0 1 -3) (position 0 1 3) 0.3))
(define body (bool:subtract body c))
 
(define faces (entity:faces body))
 
(entity:delete (face:unhook (list-ref faces 0)))
(entity:delete (face:unhook (list-ref faces 4)))
(entity:delete (face:unhook (list-ref faces 5)))
(entity:delete (face:unhook (list-ref faces 6)))
(entity:delete (face:unhook (list-ref faces 7)))
(entity:delete (face:unhook (list-ref faces 8)))
(entity:delete (face:unhook (list-ref faces 9)))
 
(define face_list (list (list-ref faces 2) (list-ref faces 3)))
;; Remove operation is invalid 
;; *** Error rem:remove-faces: free ( sheet ) edge detected
(rem:remove-faces face_list)
Red Faces Are Being Removed (Invalid Case)

Using api_remove_open_gap on the free edge (that does not form an internal gap) followed by api_remove_faces creates the result shown in Example 2.

Additional Examples

The following images show the before and after of the remove operation on faces with free edges that form multiple internal gaps.

Red Faces Are Being Removed
Result After Remove
Red Faces Are Being Removed
Result After Remove

The following images show two instances where the remove operation is not defined.

Red Faces Are Being Removed (Invalid Case)
Red Faces Are Being Removed (Invalid Case)
Personal tools
Live