SchemeExt:Entity:detect-depression

From DocR23

Jump to: navigation, search
Showproduct.png



Contents

Action

Detects a depression on a model based on an input seed face.

Filename

scm/scmext/lop/lop_scm.cpp

APIs

api_detect_depression

Syntax

(entity:detect-depression seed-face [detect-feature-opts])

Argument Types

Argument Scheme Data Type
seed-face face
detect-feature-opts detect-feature-options

Returns

(face ...)

Description

This Scheme extension detects a depression feature on the model. Given a seed face belonging to the depression feature, the collection of contiguous faces constituting the entire feature is returned. Specific examples of depression feature are: cut, pocket, slot, and hole.

Limitations

  • Mixed convexity edges are not handled well.

Arguments

  • seed-face specifies the seed face on the depression.
  • detect-feature-opts specifies the options object to control the depression detection parameters.

Example 1

(part:clear)
; Create a model with depression.
(define block1 (solid:block (position -20 -20 -20) (position 20 25 25)))
(define block2 (solid:block (position -5 -20 -30) (position 30 15 35)))
(bool:subtract block2 block1)
 
;Pick a seed face from the depression.
(ray:queue 89.8179 -78.9733 -22.3511 -0.74136 0.543114 0.394223 1)
(define seed_face (pick-face))
(entity:set-color seed_face GREEN)
 
;Collect all depression faces
(define depression_faces (entity:detect-depression seed_face ))
(entity:set-color depression_faces YELLOW)

Example 2

(part:clear)
(define cyl (solid:cylinder (position 0 0 0)(position 0 0 7) 25))
 
;;inner cylinder
 
(define cyl2 (solid:cylinder (position 0 0 0)(position 0 0 2) 15))
(define cyl3 (solid:cylinder (position 0 0 0)(position 0 0 2) 10))
(define cyl2 (bool:subtract cyl2 cyl3))
(define cyl (bool:subtract cyl cyl2))
 
(define cyl4 (solid:cylinder (position 0 0 1)(position 0 0 6) 25))
(define cyl5 (solid:cylinder (position 0 0 1)(position 0 0 6) 23))
(define cyl4 (bool:subtract cyl4 cyl5))
(define cyl (bool:subtract cyl cyl4))
 
(define cyl2 (solid:cylinder (position 0 0 7)(position 0 0 5) 15))
(define cyl3 (solid:cylinder (position 0 0 7)(position 0 0 5) 10))
(define cyl2 (bool:subtract cyl2 cyl3))
(define cyl (bool:subtract cyl cyl2))
 
(blend:entities (entity:edges (part:entities)) 0.5 'fix)
 
(ray:queue -11.6357 -9.77088 -10.1514 0.0276099 0.769945 0.637513 0.167772)
(define seed_face (pick-face))
(entity:set-color seed_face GREEN)
 
;Collect all depression faces
(define depression_faces (entity:detect-depression seed_face ))
(entity:set-color depression_faces YELLOW)

See Also

Personal tools