API Reference

The following functions define the Python scripting interface of queddy's modeling kernel.

Edge, face, and vertex properties

The following keyword arguments are used in several API functions where edge, face, and vertex properties need to be specified:

m: face material id

The face material id m is a string value.

queddy's modeling kernel does not support material definitions but can put a placeholder for each material id in the target model format with a default material definition.

p: vertex position

The vertex position p is a list of homogeneous coordinates: [x, y, z, w].

The following two short forms are allowed and the omitted coordinates are internally added with their default values:

  • [x, y, z][x, y, z, 1]
  • [x, y][x, y, 0, 1]
s: edge sharpness

The edge sharpness s is a boolean value.

The following constants are defined:

  • SMOOTH = False for smooth edges
  • SHARP = True for sharp edges

Euler operators

mvefs() ⇔ kvefs()
 
e = mvefs(*, p0, p1, s, m=None)

makes two new vertices, a new edge, and a new face for a new shell.

Parameters:

  • p0: position for the created vertex v0
  • p1: position for the created vertex v1
  • s: sharpness value for the created edge
  • m: material id for the created face

Returns:

  • e: integer id of the created edge
kvefs(e)

kills the last two vertices, the last edge, and the last face of a shell.

Parameters:

  • e: integer id of the edge to be destroyed
mev() ⇔ kev()

Fig. 1: vertex split

Fig. 2: edge split

Fig. 3: dangling vertex (1)

Fig. 4: dangling vertex (2)

 
e = mev(e0, e1, *, s, p)

makes a new edge to a new vertex.

Parameters:

  • e0: integer id of a first existing edge
  • e1: integer id of a second existing edge
  • s: sharpness value for the created edge
  • p: position for the created vertex

Returns:

  • e: integer id of the created edge
kev(e)

kills an edge and its vertex.

Parameters:

  • e: integer id of the edge to be destroyed
mef() ⇔ kef()
 
e = mef(e0, e1, *, s, m=None)

makes a new edge and a new face.

Parameters:

  • e0: integer id of a first existing edge
  • e1: integer id of a second existing edge
  • s: sharpness value for the created edge
  • m: material id for the created face

Returns:

  • e: integer id of the created edge
kef(e)

kills an edge and its face.

Parameters:

  • e: integer id of the edge to be destroyed
mekr() ⇔ kemr()
 
e = mekr(e_ring, e_face, *, s)

makes an edge to a ring which is then killed.

Parameters:

  • e_ring: integer id of an edge of the ring to be destroyed
  • e_face: integer id of an edge of the base face of the ring to be destroyed
  • s: sharpness value for the created edge

Returns:

  • e: integer id of the created edge
e_ring = kemr(e)

kills an edge to make a ring from the remaining closed edge chain.

Parameters:

  • e: integer id of the edge to be destroyed

Returns:

  • e_ring: integer id of an edge of the ring
mfkrh() ⇔ kfmrh()
 
mfkrh(e_ring, *, m=None)

makes a face from a ring hole which is thereby killed.

Parameters:

  • e_ring: integer id of an edge of the ring hole to be destroyed
  • m: material id for the created face
kfmrh(e0, e1)

kills a face to make a ring hole out of it in another face.

Parameters:

  • e0: integer id of an edge of the face to be destroyed
  • e1: integer id of an edge of the face in which the ring hole is created

Mesh evaluation

getm()
m = getm(e)

Returns the material id m of the face of edge e.

Parameters:

  • e: integer id of an edge

Returns:

  • m: the requested material id
getp()
p = getp(e)

Returns the position p of the vertex of edge e.

Parameters:

  • e: integer id of an edge

Returns:

  • p: the requested position
gets()
s = gets(e)

Returns the sharpness value s of edge e.

Parameters:

  • e: integer id of an edge

Returns:

  • s: the requested sharpness value
hasr()
b = hasr(e)

Checks if the face of edge e has one or more rings.

Parameters:

  • e: integer id of an edge

Returns:

  • b: boolean result of the check
isbf()
b = isbf(e)

Checks if the face of edge e is a baseface (and not a ring).

Parameters:

  • e: integer id of an edge

Returns:

  • b: boolean result of the check
samee()
b = samee(e0, e1)

Checks if both edges are either equal or mates.

Parameters:

  • e0: integer id of a first edge
  • e1: integer id of a second edge

Returns:

  • b: boolean result of the check
samef()
b = samef(e0, e1)

Checks if both edges belong to the same face or ring.

Parameters:

  • e0: integer id of a first edge
  • e1: integer id of a second edge

Returns:

  • b: boolean result of the check
samev()
b = samev(e0, e1)

Checks if both edges are incident to the same vertex.

Parameters:

  • e0: integer id of a first edge
  • e1: integer id of a second edge

Returns:

  • b: boolean result of the check

Mesh manipulation

setm()
setm(e, m)

Sets the material id m of the face belonging to edge e.

Parameters:

  • e: integer id of an edge
  • m: material id of the face belonging to edge e
setp()
setp(e, p)

Sets the position p of the vertex belonging to edge e.

Parameters:

  • e: integer id of an edge
  • p: position of the vertex belonging to edge e
sets()
sets(e, s)

Sets the sharpness value s of edge e.

Parameters:

  • e: integer id of an edge
  • s: sharpness value of edge e
mve()
mve(e, vec)

Moves edge e by vector vec.

Parameters:

  • e: integer id of an edge
  • vec: 3-dimensional vector
mvf()
mve(e, vec)

Moves the face belonging to edge e by vector vec.

Parameters:

  • e: integer id of an edge
  • vec: 3-dimensional vector
mvv()
mve(e, vec)

Moves the vertex belonging to edge e by vector vec.

Parameters:

  • e: integer id of an edge
  • vec: 3-dimensional vector
sharpe()
sharpe(e, s)

Sets the sharpness value of edge e.

Parameters:

  • e: integer id of an edge
  • s: sharpness value
sharpf()
sharpf(e, s)

Sets the sharpness value of all edges belonging to the face of edge e.

Parameters:

  • e: integer id of an edge
  • s: sharpness value
sharpv()
sharpv(e, s)

Sets the sharpness value of all edges incident to the vertex of edge e.

Parameters:

  • e: integer id of an edge
  • s: sharpness value

Mesh navigation

vcw()/vccw()
e_vcw = vcw(e)

Navigates to the next edge of the vertex of edge e in clock-wise direction.

Parameters:

  • e: integer id of an edge

Returns:

  • e_vcw: integer id of the next edge of the vertex in clock-wise direction
e_vccw = vccw(e)

Navigates to the next edge of the vertex of edge e in counter-clock-wise direction.

Parameters:

  • e: integer id of an edge

Returns:

  • e_vccw: integer id of the next edge of the vertex in counter-clock-wise direction
ef()
e_mate = ef(e)

Navigates to the complementary half edge of edge e (its "mate"). This operation flips the direction of edge e and thus selects the vertex and face of the other side.

Parameters:

  • e: integer id of an edge

Returns:

  • e_mate: integer id of the complementary half edge
fcw()/fccw()
e_fcw = fcw(e)

Navigates to the next edge of the face of edge e in clock-wise direction.

Parameters:

  • e: integer id of an edge

Returns:

  • e_fcw: integer id of the next edge of the face in clock-wise direction
e_fccw = fccw(e)

Navigates to the next edge of the face of edge e in counter-clock-wise direction.

Parameters:

  • e: integer id of an edge

Returns:

  • e_fccw: integer id of the next edge of the face in counter-clock-wise direction
nr()
e_nr = nr(e)

Navigates to the next ring of the face/ring of edge e or back to the base face if there is no next ring.

Parameters:

  • e: integer id of an edge

Returns:

  • e_nr: integer id of an edge of the next ring of the face/ring or the base face if there is no next ring
bf()
e_bf = bf(e)

Navigates to the base face of the face/ring of edge e.

Parameters:

  • e: integer id of an edge

Returns:

  • e_bf: integer id of an edge of the base face of the face/ring

Others

exit()
exit()

Exits the script.

export()
export(key, value)

Exports value to queddy's modeling kernel. Depending on the requested model format, queddy's modeling kernel can consider value in its response.

Parameters:

  • key: the key of the exported value
  • value: the value of the exported value
log()
log(msg)

Writes a message into the Messages panel of the qME Modeling Environment. Depending on the requested model format, queddy's modeling kernel can include the message in its response.

Parameters:

  • msg: message string