SchemeExt:Sheet:cover-wires
From DocR21
Contents |
Action
Creates a solid body from a wire body.
Filename
scm/scmext/covr/covr_scm.cpp
APIs
api_check_wire_self_inters, api_cover_wires
Syntax
(sheet:cover-wires body [surf|co] [acis-opts])
Argument Types
| Argument | Scheme Data Type |
|---|---|
| body | wire-body |
| surf | face |
| co | cover_options |
| acis-opts | acis-options |
Returns
body
Description
This extension covers a wire body with one or more faces, creating an open solid body. It attempts to determine a surface which contains the edges of each wire. If a surface can be calculated, it is used for the geometry of the face. If a surface cannot be calculated, a face with no geometric definition is created and a warning message displayed. The wire must be closed and not self-intersecting. When a face is defined with the optional surf argument, the underlying surface of that face is used for the geometry in covering the wire body.
Note that when you specify the covering surface (either via the surf argument or cover_options::set_covering_surface), the given wire body is covered using the geometry you specify. That is, a face is made where the boundary is a loop from the given wire body and the surface geometry is the covering surface. This method of using the Scheme command requires you to find a covering surface, but allows much more flexibility in how you cover a wire.
The cover_options argument can be used to specify a cover surface, and also an allowable gap tolerance. If the gap tolerance is specified, the specified covering surface or the best fit plane are allowed to miss the circuit being covered by any amount less than the gap tolerance. When specifying gap tolerance, you may also specify a tolerize_entity_opts object to control precisely how the body is tolerized after covering. The default behavior if no tolerance is specified is to disallow gaps, and therefore have no need to tolerize.
Arguments
- body is an input body.
- surf when defined, the underlying surface of that face is used for the geometry in covering the wire body.
- co when defined, gives options about how the cover will be done. This argument is mutually exclusive with the surf argument.
- acis-opts contains journaling and versioning information.
Example 1
; sheet:cover-wires (part:clear) ; Create circular edge 1. (define edge1 (edge:circular (position 0 0 0) 20 0 180)) ;; edge1 ; Create linear edge 2. ; Set a color for edge1 (entity:set-color edge1 2) ;; () (define edge2 (edge:linear (position -20 0 0) (position -20 0 20))) ;; edge2 ; Set a color for edge2 (entity:set-color edge2 3) ;; () ; Create circular edge 3. (define edge3 (edge:circular (position 0 0 20) 20 0 180)) ;; edge3 ; Set a color for edge3 (entity:set-color edge3 4) ;; () ; Create linear edge 4. (define edge4 (edge:linear (position 20 0 20) (position 20 0 0))) ;; edge4 ; Set a color for edge4 (entity:set-color edge4 6) ;; () ; Create a wire body from the edges. (define wire_body (wire-body (list edge1 edge2 edge3 edge4))) ;; wire_body ; OUTPUT Wire Body ; Create a sheet body from the wire body. (define sheet_body (sheet:cover-wires wire_body)) ;; sheet_body ; OUTPUT Sheet Body
Example 2: Tolerant Covering
(part:clear) ; define how far off the wires are (define delta .0005) (define ndelta -.0005) (define peturb_x (gvector delta delta delta)) (define peturb_y (gvector delta ndelta delta)) (define peturb_z (gvector delta ndelta ndelta)) ; define a set of wires which are slightly miss being adjacent (define P (position 1 0 0)) (define Q (position 0 0 0)) (define R (position 1 1 0)) (define S (position -3 0 0)) (define T (position -2 0 1)) (define e1 (edge:line R P)) (define e2 (edge:line Q (position:offset P peturb_x) ) ) (define e3 (edge:line (position:offset R peturb_y) (position:offset Q peturb_x) ) ) (define e4 (edge:line (position:offset R peturb_z) (position:offset S peturb_x) ) ) (define e5 (edge:line (position:offset S peturb_y) (position:offset T peturb_z) ) ) (define e6 (edge:circular-3pt S (position -2 1 0) T ) ) (define wire_body_list (wire-body:group (list e1 e2 e3 e4 e5 e6) .1)) (define wire (bool:unite (car wire_body_list)(cadr wire_body_list)(caddr wire_body_list))) (define co (cover:options 'gap_tol .001)) (define b (sheet:cover-wires wire co))
Example 3: Specifying Covering Surface
(define circle (wire-body (edge:circular (position 0 0 0) 3 0 360))) (define revolved-cubic (face:law "vec(u*cos(v), u*sin(v), 1 - u^3/27)" 0 10 0 (* 2 PI))) (entity:erase revolved-cubic) (define co (cover:options 'covering_surface revolved-cubic)) (sheet:cover-wires circle co)

