SchemeExt:Sheet:cover
From DocR21
Contents |
Action
Modifies an open solid body by covering each of its simple loops of external edges with a face.
Filename
scm/scmext/covr/covr_scm.cpp
APIs
Syntax
(sheet:cover body ["multiple" | co] [ao])
Argument Types
| Argument | Scheme Data Type |
|---|---|
| body | body |
| multiple | string |
| co | cover_options |
| ao | acis-options |
Returns
body
Description
This extension modifies an open solid body by covering each of its simple loops of external edges with a face.
A simple external loop of a sheet body is a list of connected edges where each edge has only a single face; that is, each edge is a free edge. For instance, a block with only five faces will have an external loop for the edges around the missing face. This Scheme extension attempts to calculate a surface containing the edges and creates a face containing the loop of these edges.
For a body with multiple external loops, this extension computes distinct surfaces for each connected, planar face. For example, a block with uncovered top and bottom will be closed. Only sheets with single external loops can be fitted with a NURBS surface, provided that they contain only three or four edges. In the case of three edges, a degenerate NURBS surface is calculated which has a parametric pole on one edge.
If a surface cannot be calculated, a FACE with no geometric definition (that is, its geometry() pointer is NULL) is created and a warning occurs.
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.
This Scheme extension used with the covering surface specified (either via surf or via the cover_options argument) empowers you to create many interesting types of geometry.
The API does not automatically account for unfixed transforms on the input sheet body, which could cause some unexpected results if you use the API while specifying the covering surface.
Arguments
- body is an input sheet body.
- multiple is used to cover a loop of external edges with multiple planes, if possible. The default value for multiple is false.
- co is a cover options object which can be used to specify a gap tolerance, tolerization options, and a covering surface.
Example 1: Unspecified Covering Surface
; sheet:cover ; Create a solid block. (define block1 (solid:block (position -20 -20 -20) (position 20 20 20))) ;; block1 ; Get a list of block's faces. (define faces1 (entity:faces block1)) ;; faces1 ; Remove the top and front faces. (define uncover (face:unhook (car faces1))) (entity:delete uncover) ;; uncover (define uncoverlist (face:unhook (car (cdr (cdr (cdr (cdr faces1))))))) (entity:delete uncoverlist) ;; uncoverlist ; Create a sheet body from the wire body. (define sheetcover (sheet:cover block1)) ;; sheetcover
Example 2: Covering Surface and Gap Tolerance Specified
(part:clear) (view:gl) (define cyl (solid:cylinder (position 0 0 0) (position 0 0 10) 3)) (entity:fix-transform cyl) (zoom-all) (ray:queue -0.488593 -0.231439 21.3936 0 0 -1 1) (entity:delete (face:unhook (pick-face))) (define paraboloid (face:law "vec(u*cos(v), u*sin(v), 19.001-(u*u))" 0 10 0 (* 2 PI))) (define co (cover:options 'covering_surface paraboloid 'gap_tol .001)) (define result (sheet:cover cyl co))

