• No results found

3.2 Data Structures

3.2.2 Properties and Limitations

In the classical VPS [MPT99] algorithm, the penalty collision forces are computed as spring-like forces following Hooke’s law. With the data structures and functions explained so far, this can be approximated by

fP= kP

X

v(Pi)>0

v(Pi)ni, (3.13)

with kP being the penalty stiffness equal for all points. In words, all the normal vectors

(force directions) of the colliding points in the pointshell (v(Pi) > 0) are weighted by

their penetration v(Pi)and summed up to yield the total penalty force fP. As explained

in the previous section, the access to the voxel value v is O(1) and, subsequently, the collision force query in (3.13) has O(n) complexity, being n the number of checked points. That leads to a central and general characteristic of the VPS:

Voxelmaps can model arbitrarily complex objects with the maximum possible resolution (given memory limits) without affecting the computation time of collision queries; on the other hand, the number of points of the point clouds which are checked for collision increases linearly the required computation time.

Clearly, controlling the number of points checked while keeping the resolution as high as possible is essential for improving time performance. This issue is addressed in SectionB. The classical VPS and the primitive data structures presented so far have other specific properties that can be exploited or limitations that should be taken into account. All these are presented in the following subsections.

3.2.2.1 Properties

Two major properties can be defined:

P1 If the number of elements (points or voxels) for a given resolution (voxel size s) is known, the number of elements for any resolution can be estimated.

P2 The physical meaning of the penalty collision forces is related to the overlapping volume.

Figure 3.3: Volumetric nature of the forces: (a) A pointshell P is penetrating into a voxelmap V. The intersection volume V is enclosed within the surfaces Ain(red, surface of the pointshell) and Aout (blue, surface of the voxelmap). If the resolution of the models is high, i. e., s → 0, pointshell points can be represented as the posi- tion variable x constrained to Ain and collision forces can be ultimately computed as a volume integral. (b) In the special case where Aout is planar, forces are directly proportional to the in- tersection volume (with s → 0), as in the case of buoyancy forces. (a) (b) δA δV Ain Aout x n(x) x y z V P x y z v(x) = − y V P V f Ain Aout

The first property P1 is derived from the principle that the real object area A and volume V are invariant for any discretization. Let I be the subset of V related to the inner or solid voxels (v ≥ 0):

I = V|v≥0, I ⊆ V. (3.14)

The number of points in P (NP) and the number of solid voxels in I (NI) can be

used to approximate the area (˜A) and the volume ( ˜V), respectively, if the corresponding resolution or voxel size s is known:

NPs2 = ˜A, NIs3 = ˜V. (3.15)

Assuming that the ratio between the real and approximated area or volume is close to constant, for a pair of different resolutions s1 and s2, it holds:

NP,1 NP,2 ' s 2 2 s21, NI,1 NI,2 ' s 3 2 s31. (3.16)

This is particularly interesting for point clouds, since their number of elements is linearly proportional to the computation time. In this line, if a pointshell with a given resolution s1 leads to a certain expected time budget ∆t1, a smaller computation time ∆t2 can be

achieved with the resolution s2 defined as

s22 = NP,1 NP,2 s21 = ∆t1 ∆t2 s21 ⇒ s2=   ∆t1 ∆t2 s1. (3.17)

The second property P2 is illustrated in Figure3.3. In there, a pointshell P overlaps with a voxelmap V giving an intersection volume V bounded with the surfaces Ain (red,

increased by decreasing the voxel size s → 0, the force associated to a colliding point x acting on a surface element δA of the pointshell is

δf (x) = kPv(x)n(x)δA, x ∈ Ain. (3.18)

As pointed out in [Bar07], the total penalty force can then be defined as a surface integral, which is equivalent to a volume integral after some operations:

fP= kP R Ainv(x)n(x)δA R AinδA 1 = kP R

Ain∪Aoutv(x)n(x)δA

Ain 2 = −kP R V∇v(x)δV Ain . (3.19) In step 1, the surface integral is extended to Aout without any effect on the total

value, since v(x) = 0 ∀x ∈ Aout, being Aout the surface of the voxelmap. In step 2,

the divergence theorem is applied, revealing the volumetric nature of the penalty forces. As a result, forces can be interpreted as proportional to the sum of the gradients of the distance field ∇v(x) acting on each overlapping volume element δV.

In the particular case of planar voxelmap contact surfaces displayed in Figure3.3(b), contact forces turn out to be proportional to the total overlap volume:

v(x) = −y ⇒ ∇v(x) = (0, −1, 0)T ⇒ fP= −kP R V∇v(x)δV Ain = kP V Ain (0, 1, 0)T. (3.20) Therefore, VPS penalty forces are closely related to the buoyancy forces. It is important to consider this physical meaning of the forces, especially when collisions against thin shells occur, as explained in the next section.

3.2.2.2 Limitations

Figure3.4illustrates the two major difficulties the VPS algorithm faces: (i) the aliasing due to discretization and (ii) the tunneling effect, characteristic of thin shells.

Aliasing occurs when continuous analog signals are sampled. In the case of VPS, this sampling refers to the discrete points on the surface of the pointshell and the regular voxel grid of the voxelmap, and it can affect both the magnitude and the direction of the forces, as analyzed in [WSM+10]. For lower resolutions (larger voxel size s), forces and, ultimately, geometries become more indistinguishable. Since the pointshell resolution is governed by the time budget, it is reasonable to address the subject through voxelmaps. In this line, the issue of aliasing is tackled in Section B by increasing the accuracy of the distance values provided by the voxelmap. This can be interpreted as a conventional

(a) (b) (c)

Figure 3.4: Pitfalls of computing collisions with voxelmaps and point clouds: (a) Signed distance and force aliasing can increase when low resolutions are used, especially in round regions. (b) Voxelized thin shell. (c) Tunneling effect or pop-though effect characteristic of penalty-based algorithms when thin shells are checked for collision: Since no inner region is distinguished, overlap volumes are formed only with surface voxels; hence, forces tend to be too weak and objects can end up going through (green points).

low pass filter that removes undesired high frequency artifacts caused by the spatial discretization not aligned with the modeled object surfaces.

The tunneling effect, also called pop-through effect [ZS95], is named after the quantum tunneling, in which a particle tunnels through a barrier that it should not cross. In col- lision computation, it occurs when penalty-based algorithms are used to render collision forces against non-watertight thin shells. As displayed in Figure3.4(c), no inner regions are distinguished for such thin surfaces. If a point manages to go through the solid sur- face (green points), it does not contribute to the collision force anymore, as it otherwise would. In other words, taking into account the volumetric force model in (3.20), overlap volumes are formed only with surface voxels of the thin shells; therefore, forces tend to be too weak and objects can end up going through, because the user is not fed with a large enough restriction. This issue is solved in Chapter4with a novel constraint-based algorithm for force rendering and proxy simulation.