Action:
|
Returns all edges from either a body or a wire that are shorter in length than the specified tolerance.
|
|
Filename:
|
bool/bool_scm/sliver_scm.cxx
|
|
APIs:
|
api_detect_short_edges
|
|
Syntax:
|
(tolerance:detect-short-edges entity [tolerance]
|
|
|
[replace])
|
|
Arg Types:
|
entity
|
entity
|
|
tolerance
|
real
|
|
replace
|
boolean
|
|
Returns:
|
entity ...
|
|
Description:
|
Returns all edges from the entity passed in that are shorter then the specified tolerance. If no tolerance is specified,
SPAresfit is used by default. The third optional argument specifies if detected short edges should be automatically replaced. By default, short edges are not replaced.
|
|
|
entity is an input entity.
|
|
|
tolerance is the specified tolerance for an input entity.
|
|
|
replace is an optional argument specifies short edges should be automatically replaced, if detected.
|
|
Example:
|
; tolerant:detect-short-edges
|
|
; Define a simple skin that results in a
|
|
; short edge being created
|
|
(define edge1 (wire-body (list
|
|
|
(edge:linear (position 0 0 0)
|
|
|
(position 1 0 0)))))
|
|
;; edge1
|
|
(define edge2 (wire-body (list (edge:linear
|
|
|
(position 0.5 1 0) (position 0.500001 1 0)))))
|
|
;; edge2
|
|
|
(define skin_ops (skin:options "arc_length"
|
|
|
#f "no_twist" #t "align" #t "solid" #f))
|
|
;; skin_ops
|
|
(define skin (sheet:skin-wires
|
|
|
(list edge1 edge2) skin_ops))
|
|
;; skin
|
|
; Check the body before the short edge replacement
|
|
(entity:check skin)
|
|
; checked:
|
|
;
|
|
1 lumps
|
|
;
|
|
1 shells
|
|
;
|
|
0 wires
|
|
;
|
|
1 faces
|
|
;
|
|
1 loops
|
|
;
|
|
4 coedges
|
|
;
|
|
4 edges
|
|
;
|
|
4 vertices
|
|
;; ()
|
|
; Detect and replace the short edge
|
|
(define short_edge
|
|
|
(tolerant:detect-short-edges skin #t))
|
|
;; short_edge
|
|
; Validate the remaining body
|
|
(entity:check skin)
|
|
;
|
|
1 lumps
|
|
;
|
|
1 shells
|
|
;
|
|
0 wires
|
|
;
|
|
1 faces
|
|
;
|
|
1 loops
|
|
;
|
|
3 coedges
|
|
;
|
|
3 edges
|
|
;
|
|
3 vertices
|
|
;; ()
|
|
(define v (entity:tvertices skin))
|
|
;; v
|
|
(define tol_edge (tolerant:report skin))
|
|
; Vertex tolerance = 4.472138e-007
|
|
; No tolerant edges
|
|
;; tol_edge
|