[Bf-blender-cvs] [b05651199b8] master: Code Quality Day: Comment formatting in bmesh_bevel.c
Hans Goudey
noreply at git.blender.org
Fri Feb 7 19:32:49 CET 2020
Commit: b05651199b87f74bc3ce7bb9ee761c8ecfe3aab8
Author: Hans Goudey
Date: Fri Feb 7 13:32:02 2020 -0500
Branches: master
https://developer.blender.org/rBb05651199b87f74bc3ce7bb9ee761c8ecfe3aab8
Code Quality Day: Comment formatting in bmesh_bevel.c
===================================================================
M source/blender/bmesh/tools/bmesh_bevel.c
===================================================================
diff --git a/source/blender/bmesh/tools/bmesh_bevel.c b/source/blender/bmesh/tools/bmesh_bevel.c
index d3b3541a539..d8c2057bb56 100644
--- a/source/blender/bmesh/tools/bmesh_bevel.c
+++ b/source/blender/bmesh/tools/bmesh_bevel.c
@@ -66,7 +66,7 @@
/* for testing */
// #pragma GCC diagnostic error "-Wpadded"
-/* Constructed vertex, sometimes later instantiated as BMVert */
+/* Constructed vertex, sometimes later instantiated as BMVert. */
typedef struct NewVert {
BMVert *v;
float co[3];
@@ -75,31 +75,31 @@ typedef struct NewVert {
struct BoundVert;
-/* Data for one end of an edge involved in a bevel */
+/* Data for one end of an edge involved in a bevel. */
typedef struct EdgeHalf {
/** Other EdgeHalves connected to the same BevVert, in CCW order. */
struct EdgeHalf *next, *prev;
- /** Original mesh edge */
+ /** Original mesh edge. */
BMEdge *e;
- /** Face between this edge and previous, if any */
+ /** Face between this edge and previous, if any. */
BMFace *fprev;
- /** Face between this edge and next, if any */
+ /** Face between this edge and next, if any. */
BMFace *fnext;
- /** Left boundary vert (looking along edge to end) */
+ /** Left boundary vert (looking along edge to end). */
struct BoundVert *leftv;
- /** Right boundary vert, if beveled */
+ /** Right boundary vert, if beveled. */
struct BoundVert *rightv;
- /** Offset into profile to attach non-beveled edge */
+ /** Offset into profile to attach non-beveled edge. */
int profile_index;
- /** How many segments for the bevel */
+ /** How many segments for the bevel. */
int seg;
- /** Offset for this edge, on left side */
+ /** Offset for this edge, on left side. */
float offset_l;
- /** Offset for this edge, on right side */
+ /** Offset for this edge, on right side. */
float offset_r;
- /** User specification for offset_l */
+ /** User specification for offset_l. */
float offset_l_spec;
- /** User specification for offset_r */
+ /** User specification for offset_r. */
float offset_r_spec;
/** Is this edge beveled? */
bool is_bev;
@@ -107,44 +107,45 @@ typedef struct EdgeHalf {
bool is_rev;
/** Is e a seam for custom loopdata (e.g., UVs)? */
bool is_seam;
- /** Used during the custom profile orientation pass */
+ /** Used during the custom profile orientation pass. */
bool visited_rpo;
char _pad[4];
} EdgeHalf;
-/* Profile specification:
+/**
+ * Profile specification:
+ * The profile is a path defined with start, middle, and end control points projected onto a
+ * plane (plane_no is normal, plane_co is a point on it) via lines in a given direction (proj_dir).
+ *
* Many interesting profiles are in family of superellipses:
* (abs(x/a))^r + abs(y/b))^r = 1
* r==2 => ellipse; r==1 => line; r < 1 => concave; r > 1 => bulging out.
* Special cases: let r==0 mean straight-inward, and r==4 mean straight outward.
- * The profile is a path defined with start, middle, and end control points
- * projected onto a plane (plane_no is normal, plane_co is a point on it)
- * via lines in a given direction (proj_dir).
- * After the parameters are all set, the actual profile points are calculated
- * and pointed to by prof_co. We also may need profile points for a higher resolution
- * number of segments for the subdivision while making the ADJ vertex mesh pattern,
- * and that goes in prof_co_2.
+ *
+ * After the parameters are all set, the actual profile points are calculated and pointed to
+ * by prof_co. We also may need profile points for a higher resolution number of segments
+ * for the subdivision while making the ADJ vertex mesh pattern, and that goes in prof_co_2.
*/
typedef struct Profile {
- /** Superellipse r parameter */
+ /** Superellipse r parameter. */
float super_r;
- /** Height for profile cutoff face sides */
+ /** Height for profile cutoff face sides. */
float height;
- /** Start control point for profile */
+ /** Start control point for profile. */
float start[3];
- /** Mid control point for profile */
+ /** Mid control point for profile. */
float middle[3];
- /** End control point for profile */
+ /** End control point for profile. */
float end[3];
- /** Normal of plane to project to */
+ /** Normal of plane to project to. */
float plane_no[3];
- /** Coordinate on plane to project to */
+ /** Coordinate on plane to project to. */
float plane_co[3];
- /** Direction of projection line */
+ /** Direction of projection line. */
float proj_dir[3];
- /** seg+1 profile coordinates (triples of floats) */
+ /** seg+1 profile coordinates (triples of floats). */
float *prof_co;
- /** Like prof_co, but for seg power of 2 >= seg */
+ /** Like prof_co, but for seg power of 2 >= seg. */
float *prof_co_2;
/** Mark a special case so the these parameters aren't reset with others. */
bool special_params;
@@ -155,27 +156,29 @@ typedef struct Profile {
#define PRO_SQUARE_IN_R 0.0f
/**
- * The un-transformed 2D storage of profile vertex locations. Also for non-custom profiles
+ * The un-transformed 2D storage of profile vertex locations. Also, for non-custom profiles
* this serves as a cache for the results of the expensive calculation of u parameter values to
- * get even spacing on superellipse for current BevelParams seg
- * and pro_super_r.
+ * get even spacing on superellipse for current BevelParams seg and pro_super_r.
*/
typedef struct ProfileSpacing {
- /** The profile's seg+1 x values */
+ /** The profile's seg+1 x values. */
double *xvals;
- /** The profile's seg+1 y values */
+ /** The profile's seg+1 y values. */
double *yvals;
- /** The profile's seg_2+1 x values, (seg_2 = power of 2 >= seg) */
+ /** The profile's seg_2+1 x values, (seg_2 = power of 2 >= seg). */
double *xvals_2;
- /** The profile's seg_2+1 y values, (seg_2 = power of 2 >= seg) */
+ /** The profile's seg_2+1 y values, (seg_2 = power of 2 >= seg). */
double *yvals_2;
/** The power of two greater than or equal to the number of segments. */
int seg_2;
- /** How far "out" the profile is, used at the start of subdivision */
+ /** How far "out" the profile is, used at the start of subdivision. */
float fullness;
} ProfileSpacing;
-/** An element in a cyclic boundary of a Vertex Mesh (VMesh) */
+/**
+ * An element in a cyclic boundary of a Vertex Mesh (VMesh), placed on each side of beveled edges
+ * where each profile starts, or on each side of a miter.
+ */
typedef struct BoundVert {
/** In CCW order. */
struct BoundVert *next, *prev;
@@ -197,107 +200,107 @@ typedef struct BoundVert {
Profile profile;
/** Are any of the edges attached here seams? */
bool any_seam;
- /** Used during delta adjust pass */
+ /** Used during delta adjust pass. */
bool visited;
- /** This boundvert begins an arc profile */
+ /** This boundvert begins an arc profile. */
bool is_arc_start;
- /** This boundvert begins a patch profile */
+ /** This boundvert begins a patch profile. */
bool is_patch_start;
- /** Is this boundvert the side of the custom profile's start */
+ /** Is this boundvert the side of the custom profile's start. */
bool is_profile_start;
char _pad[3];
- /** Length of seam starting from current boundvert to next boundvert with ccw ordering */
+ /** Length of seam starting from current boundvert to next boundvert with ccw ordering. */
int seam_len;
- /** Same as seam_len but defines length of sharp edges */
+ /** Same as seam_len but defines length of sharp edges. */
int sharp_len;
} BoundVert;
-/** Mesh structure replacing a vertex */
+/** Data for the mesh structure replacing a vertex. */
typedef struct VMesh {
- /** Allocated array - size and structure depends on kind */
+ /** Allocated array - size and structure depends on kind. */
NewVert *mesh;
- /** Start of boundary double-linked list */
+ /** Start of boundary double-linked list. */
BoundVert *boundstart;
- /** Number of vertices in the boundary */
+ /** Number of vertices in the boundary. */
int count;
- /** Common number of segments for segmented edges (same as bp->seg) */
+ /** Common number of segments for segmented edges (same as bp->seg). */
int seg;
- /** The kind of mesh to build at the corner vertex meshes */
+ /** The kind of mesh to build at the corner vertex meshes. */
enum {
- M_NONE, /* no polygon mesh needed */
- M_POLY, /* a simple polygon */
- M_ADJ, /* "adjacent edges" mesh pattern */
- M_TRI_FAN, /* a simple polygon - fan filled */
- M_CUTOFF, /* A triangulated face at the end of each profile */
+ M_NONE, /* No polygon mesh needed. */
+ M_POLY, /* A simple polygon. */
+ M_ADJ, /* "Adjacent edges" mesh pattern. */
+ M_TRI_FAN, /* A simple polygon - fan filled. */
+ M_CUTOFF, /* A triangulated face at the end of each profile. */
} mesh_kind;
int _pad;
} VMesh;
-/* Data for a vertex involved in a bevel */
+/* Data for a vertex involved in a bevel. */
typedef struct BevVert {
- /** Original mesh vertex */
+ /** Original mesh vertex. */
BMVert *v;
- /** Total number of edges around the vertex (excluding wire edges if edge beveling) */
+ /** Total number of edges around the vertex (excluding wire edges if edge beveling). */
int edgecount;
- /** Number of selected edges around the vertex */
+ /** Number of selected edges around the vertex. */
int selcount;
- /** Count of wire edges */
+ /** Count of wire edges. */
int wirecount;
- /** Offset for this vertex, if vertex_only bevel */
+ /** Offset for this vertex, if vertex_only bevel. */
float offset;
/** Any seams on attached edges? */
bool any_seam;
- /** Used in graph traversal */
+ /** Used in graph traversal for adjusting offsets. */
bool visited;
- /** Array of size edgecount; CCW order from vertex normal side */
+ /** Array of size edgecount; CCW order from vertex normal side. */
char _pad[6];
EdgeHalf *edges;
- /** Array of size wirecount of wire edges */
+ /** Array of size wirecount of wire edges. */
BMEdge **wire_edges;
- /** Mesh structure for replacing vertex */
+ /** Mesh structure for replacing vert
@@ Diff output truncated at 10240 characters. @@
More information about the Bf-blender-cvs
mailing list