## distance

## dist obj

### dist obj(id1) obj(id2)

Returns the distance of objets**id1** and **id2**.

**obj** obj can be:

fac(num)vol(id)

line(x1,y1,z1,x2,y2,z2)

poi(x,y,z)

vertex(s)vol(id))

mouse(s)

vol(id)

**Options:**

**matrix**: with transformations by the matrix of the objects
(only for volumes).

The following commands are implemented:

dist vol(id1)vol(id2): Returns the distance from volume **id1** to volume **id2**.

dist vol(id) poi(p): Returns the distance from volume **id** to the point **p**.

dist mouse(s)field(id): Returns the distance from the mouse
to field.

dist vol(id) line(P1,P2): Returns the distance from the center of gravity of volume **id** to segment 3D **(P1,P2)**.

dist poi(p) line(P1,P2,P3): Returns the distance from point **p** to the plane **(P1,P2,P3)**.
## dist fac vol

### dist fac(f1,f2) vol(id)

Returns the distance from facet **f1** fo facet **f2** of volume **id**.
## dist brush

### dist brush(id)

Returns the distance of brush **id**.
### dist brush(id)=d

Changes this distance.

**Notes:**

1) **d** is the minimum distance of two consecutive normalized inputs to the
size of the brush **id** (usually 0.7).

Avoids a brush to rewrite itself.

2) This command is not meaningful for a
programmable brush.
## dist poi

### dist poi(p)fac(f) vol(id)

Returns the distance from point **p** to the center of gravity of des facets **f** of volume **id**.
### dist poi(p)line(p1,p2)

Returns the distance from point **p** to segment **[p1,p2]**.
### dist poi(p)line(p1,p2,p3)

Returns the distance from point **p** to the plane through the three points **(p1, p2 ,p3)**.

If three points are collinear, returns the distance from **p** to the line **p1, p2, p3**.

If the three points coincide, returns the distance of the point **p** to the point **p1 = p2 = p3**.
### dist poi(p)obj(id)

Returns the distance from **p** to the center of gravity of object**id** of type obj.
.

**Options:**

**matrix**: taking into account the matrix transformations on objects **id**.
### dist poi(x,y,z)vol(id)vertex

Returns **num,v** number of volume and number of vertex closest fo poi **x,y,z**, volume **id**
may bee the root of an anchorage.
## dist stock

### dist stock mouse

Returns the minimum distance for the mouse capture by stock mouse.
### dist stock mouse=d

Changes this distance.
## dist vertex vol

### dist vertex(s1,s2) vol(id)

Returns the distance from vertex **s1** to vertex **s2** of volume **id**.
## dist mouse

### dist mouse obj(id)

Returns the distance from the mouse to the objects obj identificateuts **id**.

**Options:**

displ: displays the segment joining the mouse to the center of gravity of objects **id**.

**col(r,v,b)** color (white default).

**dim(d1,d2,n)**: specifies the thickness **d1** (1 by default) segment
If **d2** is present displays disk radius **d2** and **n** sides (6 by default) at the point designated by the mouse and CG objects **id**.
## See also: