SchemeExt:Entity:dist

From DocR23

Jump to: navigation, search
Showdoc.png



Contents

Action

Gets the minimum distance between two entitys or an entity and a position.

Filename

scm/scmext/intr/ilaw_scm.cpp

APIs

api_entity_entity_distance, api_entity_point_distance

Syntax

(entity:dist part1 part2 [acis-opts])

Argument Types

Argument Scheme Data Type
part1 entity | position
part2 entity | position
acis-opts acis-options

Returns

(real 
   position_1 parameter_1 entity_1 string_1
   position_2 parameter_2 entity_2 string_2 )

Description

Using the two input entities, this finds a position on each entity such that the distance between the two is the minimum distance. Supported entities include vertex, edge, loop, face, wire, shell, lump and body. The command can also find the minimum distance using an entity and a position, or a position and an entity.

The output of entity:dist has the form

real       : Minimum distance value

position_1 : position on part_1
position_2 : position on part_2

parameter_1: is zero, when entity_1 is a vertex
             is real, when entity_1 is an edge
             is par-pos, when entity_1 is a face 
parameter_2: is zero, when entity_2 is a vertex
             is real, when entity_2 is an edge
             is par-pos, when entity_2 is a face

entity_1   : entity of part1 closest to part2
entity_2   : entity of part2 closest to part1

string_1   : String denoting the type of closest entity of part1, for example, "VERTEX", "EDGE", or "FACE"
string_2   : String denoting the type of closest entity of part2, for example, "VERTEX", "EDGE", or "FACE"

Note: The position and the entity information returned in the output are not guaranteed to be unique.


Limitations

If part1 is defined as a position, part2 must be an entity.

Arguments

  • part1 specifies an entity or position.
  • part2 specifies an entity or position.
  • acis-opts enables journaling and versioning options.

Example

; entity:dist
; Create a law surface and lemon torus.
(define c1 (face:law "vec (x,y,sin (x)*cos (y))" -10 10 -10 10))
;; c1
(define c2 (face:torus (position 0 0 9.5) -5 10 0 360 0 360 (gvector 0 0 -1)))
;; c2
; Get minimum distance between faces
(entity:dist c1 c2)
;; (0.524346640596345 
;;   #[ position 0.840486691606062 4.14129658535988e-018 0.744967880321401 ]
;;     #[ par-pos 0.840486691606062 4.14129658535988e-018 ] 
;;     #[entity 1 1] 
;;     "FACE" 
;;   #[ position 0.549500560406595 6.72921877702874e-017 1.18116333072665 ] 
;;     #[ par-pos 0.982493399052537 3.14159265358979 ] 
;;     #[entity 2 1] 
;;     "FACE")
Two Faces
Personal tools