pcb 4.1.1
An interactive printed circuit board layout editor.

isotetra.c File Reference

#include <math.h>
#include <string.h>
#include <gts.h>
Include dependency graph for isotetra.c:

Go to the source code of this file.

Data Structures

struct  slice_t
struct  tetra_vertex_t
struct  helper_t
struct  helper_bcl

Functions

static helper_tinit_helper (int nx, int ny)
static helper_bclinit_helper_bcl (void)
static void free_helper (helper_t *h)
static void free_helper_bcl (helper_bcl *h)
static void helper_advance (helper_t *h)
static void helper_advance_bcl (helper_bcl *h)
static GtsVertexget_vertex (gint mz, const tetra_vertex_t *v1, const tetra_vertex_t *v2, helper_t *help, GtsCartesianGrid *g, GtsVertexClass *klass)
static GtsVertexget_vertex_bcl (gint mz, const tetra_vertex_t *v1, const tetra_vertex_t *v2, helper_bcl *help, GtsCartesianGrid *g, GtsVertexClass *klass)
static GtsEdgeget_edge (GtsVertex *v1, GtsVertex *v2, GtsEdgeClass *klass)
static void add_face (GtsSurface *surface, const tetra_vertex_t *a1, const tetra_vertex_t *a2, const tetra_vertex_t *b1, const tetra_vertex_t *b2, const tetra_vertex_t *c1, const tetra_vertex_t *c2, gint rev, helper_t *help, gint z, GtsCartesianGrid *g)
static void add_face_bcl (GtsSurface *surface, const tetra_vertex_t *a1, const tetra_vertex_t *a2, const tetra_vertex_t *b1, const tetra_vertex_t *b2, const tetra_vertex_t *c1, const tetra_vertex_t *c2, gint rev, helper_bcl *help, gint z, GtsCartesianGrid *g)
static slice_tnew_slice (gint nx, gint ny)
static void slice_init (slice_t *slice, gdouble inival)
static void free_slice (slice_t *slice)
static void analyze_tetrahedra (const tetra_vertex_t *a, const tetra_vertex_t *b, const tetra_vertex_t *c, const tetra_vertex_t *d, gint parity, GtsSurface *surface, helper_t *help, gint z, GtsCartesianGrid *g)
static void analyze_tetrahedra_bcl (const tetra_vertex_t *a, const tetra_vertex_t *b, const tetra_vertex_t *c, const tetra_vertex_t *d, GtsSurface *surface, helper_bcl *help, gint z, GtsCartesianGrid *g)
static void iso_slice_evaluate (slice_t *s1, slice_t *s2, GtsCartesianGrid g, gint z, GtsSurface *surface, helper_t *help)
static void iso_slice_evaluate_bcl (slice_t *s1, slice_t *s2, slice_t *s3, GtsCartesianGrid g, gint z, GtsSurface *surface, helper_bcl *help)
static void copy_to_bounded (slice_t *dest, slice_t *src, gdouble iso, gdouble fill)
static void iso_sub (slice_t *s, gdouble iso)
void gts_isosurface_tetra_bounded (GtsSurface *surface, GtsCartesianGrid g, GtsIsoCartesianFunc f, gpointer data, gdouble iso)
void gts_isosurface_tetra (GtsSurface *surface, GtsCartesianGrid g, GtsIsoCartesianFunc f, gpointer data, gdouble iso)
void gts_isosurface_tetra_bcl (GtsSurface *surface, GtsCartesianGrid g, GtsIsoCartesianFunc f, gpointer data, gdouble iso)

Function Documentation

static void add_face ( GtsSurface surface,
const tetra_vertex_t a1,
const tetra_vertex_t a2,
const tetra_vertex_t b1,
const tetra_vertex_t b2,
const tetra_vertex_t c1,
const tetra_vertex_t c2,
gint  rev,
helper_t help,
gint  z,
GtsCartesianGrid g 
) [static]

Definition at line 247 of file isotetra.c.

References _GtsSurface::edge_class, _GtsSurface::face_class, get_edge(), get_vertex(), gts_face_new(), gts_surface_add_face(), and _GtsSurface::vertex_class.

Referenced by analyze_tetrahedra(), and gts_surface_add_face().

Here is the call graph for this function:

static void add_face_bcl ( GtsSurface surface,
const tetra_vertex_t a1,
const tetra_vertex_t a2,
const tetra_vertex_t b1,
const tetra_vertex_t b2,
const tetra_vertex_t c1,
const tetra_vertex_t c2,
gint  rev,
helper_bcl help,
gint  z,
GtsCartesianGrid g 
) [static]

Definition at line 278 of file isotetra.c.

References _GtsSurface::edge_class, _GtsSurface::face_class, get_edge(), get_vertex_bcl(), gts_face_new(), gts_surface_add_face(), and _GtsSurface::vertex_class.

Referenced by analyze_tetrahedra_bcl().

Here is the call graph for this function:

static void analyze_tetrahedra ( const tetra_vertex_t a,
const tetra_vertex_t b,
const tetra_vertex_t c,
const tetra_vertex_t d,
gint  parity,
GtsSurface surface,
helper_t help,
gint  z,
GtsCartesianGrid g 
) [static]

Definition at line 350 of file isotetra.c.

References add_face(), and tetra_vertex_t::d.

Referenced by iso_slice_evaluate().

Here is the call graph for this function:

static void analyze_tetrahedra_bcl ( const tetra_vertex_t a,
const tetra_vertex_t b,
const tetra_vertex_t c,
const tetra_vertex_t d,
GtsSurface surface,
helper_bcl help,
gint  z,
GtsCartesianGrid g 
) [static]

Definition at line 397 of file isotetra.c.

References add_face_bcl(), and tetra_vertex_t::d.

Referenced by iso_slice_evaluate_bcl().

Here is the call graph for this function:

static void copy_to_bounded ( slice_t dest,
slice_t src,
gdouble  iso,
gdouble  fill 
) [static]

Definition at line 544 of file isotetra.c.

References slice_t::data, slice_t::nx, slice_t::ny, x, and y.

Referenced by gts_isosurface_tetra_bounded().

static void free_helper ( helper_t h) [static]

Definition at line 72 of file isotetra.c.

References helper_t::vbot, helper_t::vmid, and helper_t::vtop.

Referenced by gts_isosurface_tetra(), and gts_isosurface_tetra_bounded().

static void free_helper_bcl ( helper_bcl h) [static]

Definition at line 80 of file isotetra.c.

References helper_bcl::vbot, and helper_bcl::vtop.

Referenced by gts_isosurface_tetra_bcl().

static void free_slice ( slice_t slice) [static]
static GtsEdge* get_edge ( GtsVertex v1,
GtsVertex v2,
GtsEdgeClass klass 
) [static]

Definition at line 229 of file isotetra.c.

References edge, GTS_EDGE, gts_edge_new(), GTS_IS_EDGE, gts_vertices_are_connected(), and s.

Referenced by add_face(), and add_face_bcl().

Here is the call graph for this function:

static GtsVertex* get_vertex ( gint  mz,
const tetra_vertex_t v1,
const tetra_vertex_t v2,
helper_t help,
GtsCartesianGrid g,
GtsVertexClass klass 
) [static]
void gts_isosurface_tetra ( GtsSurface surface,
GtsCartesianGrid  g,
GtsIsoCartesianFunc  f,
gpointer  data,
gdouble  iso 
)

gts_isosurface_tetra: : a GtsSurface. : a GtsCartesianGrid. : a GtsIsoCartesianFunc. : user data to be passed to . : isosurface value.

Adds to new faces defining the isosurface f(x,y,z) = . By convention, the normals to the surface are pointing toward the positive values of f(x,y,z) - .

The user function is called successively for each value of the z coordinate defined by . It must fill the corresponding (x,y) plane with the values of the function for which the isosurface is to be computed.

Definition at line 693 of file isotetra.c.

References slice_t::data, _GtsCartesianGrid::dz, f, free_helper(), free_slice(), helper_advance(), init_helper(), iso_slice_evaluate(), iso_sub(), new_slice(), _GtsCartesianGrid::nx, _GtsCartesianGrid::ny, _GtsCartesianGrid::nz, and _GtsCartesianGrid::z.

Here is the call graph for this function:

void gts_isosurface_tetra_bcl ( GtsSurface surface,
GtsCartesianGrid  g,
GtsIsoCartesianFunc  f,
gpointer  data,
gdouble  iso 
)

gts_isosurface_tetra_bcl: : a GtsSurface. : a GtsCartesianGrid. : a GtsIsoCartesianFunc. : user data to be passed to . : isosurface value.

Adds to new faces defining the isosurface f(x,y,z) = . By convention, the normals to the surface are pointing toward the positive values of f(x,y,z) - .

The user function is called successively for each value of the z coordinate defined by . It must fill the corresponding (x,y) plane with the values of the function for which the isosurface is to be computed.

This version produces the dual "body-centered" faces relative to the faces produced by gts_isosurface_tetra().

Definition at line 773 of file isotetra.c.

References slice_t::data, _GtsCartesianGrid::dz, f, free_helper_bcl(), free_slice(), helper_advance_bcl(), init_helper_bcl(), iso_slice_evaluate_bcl(), iso_sub(), new_slice(), _GtsCartesianGrid::nx, _GtsCartesianGrid::ny, _GtsCartesianGrid::nz, and _GtsCartesianGrid::z.

Here is the call graph for this function:

void gts_isosurface_tetra_bounded ( GtsSurface surface,
GtsCartesianGrid  g,
GtsIsoCartesianFunc  f,
gpointer  data,
gdouble  iso 
)

gts_isosurface_tetra_bounded: : a GtsSurface. : a GtsCartesianGrid. : a GtsIsoCartesianFunc. : user data to be passed to . : isosurface value.

Adds to new faces defining the isosurface f(x,y,z) = . By convention, the normals to the surface are pointing toward the positive values of f(x,y,z) - . To ensure a closed object, a boundary of G_MINDOUBLE is added around the domain

The user function is called successively for each value of the z coordinate defined by . It must fill the corresponding (x,y) plane with the values of the function for which the isosurface is to be computed.

Definition at line 603 of file isotetra.c.

References copy_to_bounded(), slice_t::data, _GtsCartesianGrid::dx, _GtsCartesianGrid::dy, _GtsCartesianGrid::dz, f, free_helper(), free_slice(), helper_advance(), init_helper(), iso_slice_evaluate(), new_slice(), _GtsCartesianGrid::nx, _GtsCartesianGrid::ny, _GtsCartesianGrid::nz, slice_init(), _GtsCartesianGrid::x, _GtsCartesianGrid::y, and _GtsCartesianGrid::z.

Here is the call graph for this function:

static void helper_advance ( helper_t h) [static]

Definition at line 89 of file isotetra.c.

References help(), helper_t::nx, helper_t::ny, helper_t::vbot, helper_t::vmid, and helper_t::vtop.

Referenced by gts_isosurface_tetra(), and gts_isosurface_tetra_bounded().

Here is the call graph for this function:

static void helper_advance_bcl ( helper_bcl h) [static]

Definition at line 99 of file isotetra.c.

References help(), helper_bcl::vbot, and helper_bcl::vtop.

Referenced by gts_isosurface_tetra_bcl().

Here is the call graph for this function:

static helper_t* init_helper ( int  nx,
int  ny 
) [static]
static helper_bcl* init_helper_bcl ( void  ) [static]

Definition at line 63 of file isotetra.c.

References helper_bcl::vbot, and helper_bcl::vtop.

Referenced by gts_isosurface_tetra_bcl().

static void iso_slice_evaluate ( slice_t s1,
slice_t s2,
GtsCartesianGrid  g,
gint  z,
GtsSurface surface,
helper_t help 
) [static]
static void iso_slice_evaluate_bcl ( slice_t s1,
slice_t s2,
slice_t s3,
GtsCartesianGrid  g,
gint  z,
GtsSurface surface,
helper_bcl help 
) [static]
static void iso_sub ( slice_t s,
gdouble  iso 
) [static]

Definition at line 572 of file isotetra.c.

References slice_t::data, slice_t::nx, slice_t::ny, ptr, x, and y.

Referenced by gts_isosurface_tetra(), and gts_isosurface_tetra_bcl().

static slice_t* new_slice ( gint  nx,
gint  ny 
) [static]
static void slice_init ( slice_t slice,
gdouble  inival 
) [static]

Definition at line 326 of file isotetra.c.

References slice_t::data, slice_t::nx, slice_t::ny, x, and y.

Referenced by gts_isosurface_tetra_bounded().