Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Class Members | File Members | Related Pages

RFunction Class Reference

#include <RFunction.h>

Inheritance diagram for RFunction:

Inheritance graph
[legend]
Collaboration diagram for RFunction:

Collaboration graph
[legend]
List of all members.

Detailed Description

A subclass of blending that implements R-functions for CSG.

R-functions are blending functions that apply CSG operations to implicit surfaces. The benefit of R-functions are that they smooth the field surrounding the zero-surfaces to eliminate the creasing that can result from, say, min and max functions.

Definition at line 21 of file RFunction.h.

Protected Member Functions

virtual double h (double f, double g)
 Evaluates the R-function on the two function values.

virtual Intervald h (Intervald f, Intervald g)
virtual double hf (double f, double g)
 Evaluates the partial derivative with respect to f on the two function values.

virtual Intervald hf (Intervald f, Intervald g)
virtual double hg (double f, double g)
 Evaluates the partial derivative with respect to g on the two function values.

virtual Intervald hg (Intervald f, Intervald g)
virtual double hff (double f, double g)
 Evaluates the 2nd partial derivative with respect to f and f on the two function values.

virtual Intervald hff (Intervald f, Intervald g)
virtual double hfg (double f, double g)
 Evaluate the 2nd partial derivative with respect to f and g on the two function values.

virtual Intervald hfg (Intervald f, Intervald g)
virtual double hgg (double f, double g)
 Return the 2nd partial derivative with respect to g and g on the two function values.

virtual Intervald hgg (Intervald f, Intervald g)

Protected Attributes

double m_cont
 The continuity to be provided.

int m_sign
 The sign of the second-half of the RFunction.


Member Function Documentation

Intervald RFunction::h Intervald  f,
Intervald  g
[protected, virtual]
 

Implements Blend.

Reimplemented in AIntersection, ASubtraction, and AUnion.

Definition at line 17 of file RFunction.cpp.

References h(), Intervald, m_cont, m_sign, Interval< Type >::pow(), and Interval< Type >::squared().

double RFunction::h double  f,
double  g
[protected, virtual]
 

Evaluates the R-function on the two function values.

Parameters:
f The value of f.
g The value of g.
Returns:
(f + g + m_sign*(sqrt(f^2+g^2)))*(f^2+g^2)^(m_cont/2).

Implements Blend.

Reimplemented in AIntersection, ASubtraction, and AUnion.

Definition at line 9 of file RFunction.cpp.

References h(), m_cont, and m_sign.

Referenced by h(), and AIntersection::h().

Intervald RFunction::hf Intervald  f,
Intervald  g
[protected, virtual]
 

Reimplemented from Blend.

Reimplemented in AIntersection, ASubtraction, and AUnion.

Definition at line 40 of file RFunction.cpp.

References hf(), Intervald, m_cont, m_sign, Interval< Type >::pow(), and Interval< Type >::squared().

double RFunction::hf double  f,
double  g
[protected, virtual]
 

Evaluates the partial derivative with respect to f on the two function values.

h = (f + g + m_sign*(sqrt(f^2+g^2)))*(f^2+g^2)^(m_cont/2). hf = (f^2+g^2)^(m_cont/2)*d(f + g + m_sign*(sqrt(f^2+g^2)))/df + (f + g + m_sign*(sqrt(f^2+g^2)))*d(f^2+g^2)^(m_cont/2)/df = (f^2+g^2)^(m_cont/2)*(1 + m_sign*f/sqrt(f^2+g^2)) + (f + g + m_sign*(sqrt(f^2+g^2)))*m_cont*f*(f^2+g^2)^(m_cont/2 - 1).

Parameters:
f The value of f.
g The value of g.
Returns:
hf.
Note:
Appears to work fine when tested with particles.

Reimplemented from Blend.

Reimplemented in AIntersection, ASubtraction, and AUnion.

Definition at line 25 of file RFunction.cpp.

References hf(), m_cont, and m_sign.

Referenced by hf(), and AIntersection::hf().

Intervald RFunction::hff Intervald  f,
Intervald  g
[protected, virtual]
 

Reimplemented from Blend.

Reimplemented in AIntersection, ASubtraction, and AUnion.

Definition at line 125 of file RFunction.cpp.

References hff(), Intervald, m_cont, m_sign, Interval< Type >::pow(), and Interval< Type >::squared().

double RFunction::hff double  f,
double  g
[protected, virtual]
 

Evaluates the 2nd partial derivative with respect to f and f on the two function values.

fg = sqrt(f^2 + g^2) dfg/df = f/fg hf = fg^m_cont*(1 + m_sign*f/fg) + (f + g + m_sign*fg)*m_cont*f*fg^(m_cont - 2) = fg^m_cont + m_sign*f*fg^(m_cont-1) + (f + g + m_sign*fg)*m_cont*f*fg^(m_cont - 2) hff = m_cont*fg^(m_cont-1)*dfg/df + m_sign*f*(m_cont-1)*fg^(m_cont-2)*dfg/df + m_sign*fg^(m_cont-1) + (1 + m_sign*dfg/df)*m_cont*f*fg^(m_cont - 2) + (f + g + m_sign*fg)*m_cont*(f*(m_cont - 2)*fg^(m_cont - 3)*dfg/df + fg^(m_cont - 2)) = m_cont*f*fg^(m_cont-2) + m_sign*(m_cont-1)*f^2*fg^(m_cont-3) + m_sign*fg^(m_cont-1) + m_cont*f*fg^(m_cont - 2) + m_cont*m_sign*f^2*fg^(m_cont - 3) + m_cont*(f + g + m_sign*fg)*((m_cont - 2)*f^2*fg^(m_cont - 4) + fg^(m_cont - 2))

Parameters:
f The value of f.
g The value of g.
Returns:
hff.
Note:
Needs to be tested.

Reimplemented from Blend.

Reimplemented in AIntersection, ASubtraction, and AUnion.

Definition at line 89 of file RFunction.cpp.

References hff(), m_cont, and m_sign.

Referenced by hff(), and AIntersection::hff().

Intervald RFunction::hfg Intervald  f,
Intervald  g
[protected, virtual]
 

Reimplemented from Blend.

Reimplemented in AIntersection, ASubtraction, and AUnion.

Definition at line 276 of file RFunction.cpp.

References hfg(), Intervald, m_cont, m_sign, Interval< Type >::pow(), and Interval< Type >::squared().

double RFunction::hfg double  f,
double  g
[protected, virtual]
 

Evaluate the 2nd partial derivative with respect to f and g on the two function values.

fg = sqrt(f^2 + g^2) dfg/dg = g/fg hf = fg^m_cont*(1 + m_sign*f/fg) + (f + g + m_sign*fg)*m_cont*f*fg^(m_cont - 2) = fg^m_cont + m_sign*f*fg^(m_cont-1) + (f + g + m_sign*fg)*m_cont*f*fg^(m_cont - 2) hfg = m_cont*fg^(m_cont-1)*dfg/dg + m_sign*f*(m_cont-1)*fg^(m_cont-2)*dfg/dg + m_sign*fg^(m_cont-1) + (1 + m_sign*dfg/dg)*m_cont*f*fg^(m_cont - 2) + (f + g + m_sign*fg)*m_cont*(f*(m_cont - 2)*fg^(m_cont - 3)*dfg/dg + fg^(m_cont - 2)) = m_cont*g*fg^(m_cont-2) + m_sign*(m_cont-1)*f*g*fg^(m_cont-3) + m_sign*fg^(m_cont-1) + m_cont*f*fg^(m_cont - 2) + m_cont*m_sign*f*g*fg^(m_cont - 3) + m_cont*(f + g + m_sign*fg)*((m_cont - 2)*f*g*fg^(m_cont - 4) + fg^(m_cont - 2))

Parameters:
f The value of f.
g The value of g.
Returns:
hfg.
Note:
Needs to be tested.

Reimplemented from Blend.

Reimplemented in AIntersection, ASubtraction, and AUnion.

Definition at line 240 of file RFunction.cpp.

References hfg(), m_cont, and m_sign.

Referenced by hfg(), and AIntersection::hfg().

Intervald RFunction::hg Intervald  f,
Intervald  g
[protected, virtual]
 

Reimplemented from Blend.

Reimplemented in AIntersection, ASubtraction, and AUnion.

Definition at line 72 of file RFunction.cpp.

References hg(), Intervald, m_cont, m_sign, Interval< Type >::pow(), and Interval< Type >::squared().

double RFunction::hg double  f,
double  g
[protected, virtual]
 

Evaluates the partial derivative with respect to g on the two function values.

h = (f + g + m_sign*(sqrt(f^2+g^2)))*(f^2+g^2)^(m_cont/2). hg = (f^2+g^2)^(m_cont/2)*d(f + g + m_sign*(sqrt(f^2+g^2)))/dg + (f + g + m_sign*(sqrt(f^2+g^2)))*d(f^2+g^2)^(m_cont/2)/dg = (f^2+g^2)^(m_cont/2)*(1 + m_sign*g/sqrt(f^2+g^2)) + (f + g + m_sign*(sqrt(f^2+g^2)))*m_cont*g*(f^2+g^2)^(m_cont/2 - 1).

Parameters:
f The value of f.
g The value of g.
Returns:
hg.
Note:
Appears to work fine when tested with particles.

Reimplemented from Blend.

Reimplemented in AIntersection, ASubtraction, and AUnion.

Definition at line 57 of file RFunction.cpp.

References hg(), m_cont, and m_sign.

Referenced by hg(), and AIntersection::hg().

Intervald RFunction::hgg Intervald  f,
Intervald  g
[protected, virtual]
 

Reimplemented from Blend.

Reimplemented in AIntersection, ASubtraction, and AUnion.

Definition at line 200 of file RFunction.cpp.

References hgg(), Intervald, m_cont, m_sign, Interval< Type >::pow(), and Interval< Type >::squared().

double RFunction::hgg double  f,
double  g
[protected, virtual]
 

Return the 2nd partial derivative with respect to g and g on the two function values.

fg = sqrt(f^2 + g^2) dfg/dg = g/fg hg = fg^m_cont*(1 + m_sign*g/fg) + (f + g + m_sign*fg)*m_cont*g*fg^(m_cont - 2) = fg^m_cont + m_sign*g*fg^(m_cont-1) + (f + g + m_sign*fg)*m_cont*g*fg^(m_cont - 2) hgg = m_cont*fg^(m_cont-1)*dfg/dg + m_sign*g*(m_cont-1)*fg^(m_cont-2)*dfg/dg + m_sign*fg^(m_cont-1) + (1 + m_sign*dfg/dg)*m_cont*g*fg^(m_cont - 2) + (f + g + m_sign*fg)*m_cont*(g*(m_cont - 2)*fg^(m_cont - 3)*dfg/dg + fg^(m_cont - 2)) = m_cont*g*fg^(m_cont-2) + m_sign*(m_cont-1)*g^2*fg^(m_cont-3) + m_sign*fg^(m_cont-1) + m_cont*g*fg^(m_cont - 2) + m_cont*m_sign*g^2*fg^(m_cont - 3) + m_cont*(f + g + m_sign*fg)*((m_cont - 2)*g^2*fg^(m_cont - 4) + fg^(m_cont - 2))

Parameters:
f The value of f.
g The value of g.
Returns:
hgg.
Note:
Needs to be tested.

Reimplemented from Blend.

Reimplemented in AIntersection, ASubtraction, and AUnion.

Definition at line 164 of file RFunction.cpp.

References hgg(), m_cont, and m_sign.

Referenced by hgg(), and AIntersection::hgg().


Member Data Documentation

double RFunction::m_cont [protected]
 

The continuity to be provided.

This is stored as a double to avoid integer round-offs later.

Definition at line 29 of file RFunction.h.

Referenced by AIntersection::AIntersection(), h(), hf(), hff(), hfg(), hg(), hgg(), Intersection::init(), and Union::Union().

int RFunction::m_sign [protected]
 

The sign of the second-half of the RFunction.

This differentiates a union (= -1) from an intersection (= 1).

Note:
The sign is opposite of that used in the original R-function paper where f<0 outside.

Definition at line 38 of file RFunction.h.

Referenced by h(), hf(), hff(), hfg(), hg(), hgg(), Intersection::init(), and Union::Union().


The documentation for this class was generated from the following files:
Generated on Mon Jun 28 15:03:05 2004 for Advanced Surface Library by doxygen 1.3.4