Action:
|
Replaces a list of edges with tolerant vertices.
|
|
Filename:
|
bool/bool_scm/sliver_scm.cxx
|
|
APIs:
|
api_replace_edge_with_tvertex
|
|
Syntax:
|
(tolerant:replace-edge-with-tvertex edge-list)
|
|
Arg Types:
|
edge-list
|
entity ...
|
|
Returns:
|
entity ...
|
|
Description:
|
The argument
edge-list specifies a list of edges that will be converted to tolerant vertices.
|
|
|
The extension returns a list of tolerant vertices that were created during the replacement. This extension does not take edge lengths into consideration. It simply replaces all edges specified unless the edges are in a closed loop. If the edges are closed, replacement is not performed. If replacing short edges is desired, the extension tolerant:detect-short-edges with its replace option set to TRUE is recommended.
|
|
|
edge-list specifies a list of edges that will be converted to tolerant vertices.
|
|
Example:
|
; tolerant:replace-edge-with-tvertex
|
|
; Define a wire body with an edge to be replaced
|
|
(define wire (wire-body
|
|
|
(list (edge:linear
|
|
|
|
(position 0 0 0)
|
|
|
|
(position 3 0 0)))))
|
|
;; wire
|
|
(define edge1 (edge:linear
|
|
|
|
|
|
(position 3 0 0)
|
|
|
|
|
|
(position 3.1 0 0)))
|
|
;; edge1
|
|
(define edge2 (edge:linear
|
|
|
|
|
|
(position 3.1 0 0)
|
|
|
|
|
|
(position 5 0 0)))
|
|
;; edge2
|
|
; Replace the middle edge with a tvertex.
|
|
; First use tolerant-detect-short-edges with
|
|
; a specified tolerance to detect it.
|
|
(define short_edge
|
|
|
(tolerant:detect-short-edges wire 0.2))
|
|
;; short_edge
|
|
(define replace
|
|
|
(tolerant:replace-edge-with-tvertex short_edge))
|
|
;;
|
|
; Check the resulting body and tvertex
|
|
(entity:check wire)
|
|
;;
|
|
(entity:tvertices wire)
|
|
;;
|
|
(tolerant:report wire)
|
|
;;
|