﻿<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="ja">
	<id>https://wiki.blender.jp/index.php?action=history&amp;feed=atom&amp;title=Dev%3ASource%2FModeling%2FHeMesh%2FMeshAPI</id>
	<title>Dev:Source/Modeling/HeMesh/MeshAPI - 版の履歴</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.blender.jp/index.php?action=history&amp;feed=atom&amp;title=Dev%3ASource%2FModeling%2FHeMesh%2FMeshAPI"/>
	<link rel="alternate" type="text/html" href="https://wiki.blender.jp/index.php?title=Dev:Source/Modeling/HeMesh/MeshAPI&amp;action=history"/>
	<updated>2026-06-02T07:55:55Z</updated>
	<subtitle>このウィキのこのページに関する変更履歴</subtitle>
	<generator>MediaWiki 1.31.0</generator>
	<entry>
		<id>https://wiki.blender.jp/index.php?title=Dev:Source/Modeling/HeMesh/MeshAPI&amp;diff=46506&amp;oldid=prev</id>
		<title>Yamyam: 1版 をインポートしました</title>
		<link rel="alternate" type="text/html" href="https://wiki.blender.jp/index.php?title=Dev:Source/Modeling/HeMesh/MeshAPI&amp;diff=46506&amp;oldid=prev"/>
		<updated>2018-06-28T17:47:19Z</updated>

		<summary type="html">&lt;p&gt;1版 をインポートしました&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left&quot; data-mw=&quot;interface&quot;&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;ja&quot;&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: #fff; color: #222; text-align: center;&quot;&gt;← 古い版&lt;/td&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: #fff; color: #222; text-align: center;&quot;&gt;2018年6月28日 (木) 17:47時点における版&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-notice&quot; lang=&quot;ja&quot;&gt;&lt;div class=&quot;mw-diff-empty&quot;&gt;(相違点なし)&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;</summary>
		<author><name>Yamyam</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.blender.jp/index.php?title=Dev:Source/Modeling/HeMesh/MeshAPI&amp;diff=46505&amp;oldid=prev</id>
		<title>2010年4月3日 (土) 12:29にwiki&gt;Terrywallworkによる</title>
		<link rel="alternate" type="text/html" href="https://wiki.blender.jp/index.php?title=Dev:Source/Modeling/HeMesh/MeshAPI&amp;diff=46505&amp;oldid=prev"/>
		<updated>2010-04-03T12:29:31Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;新規ページ&lt;/b&gt;&lt;/p&gt;&lt;div&gt;=Update: Circulators and Iterators=&lt;br /&gt;
&lt;br /&gt;
I've written a basic proposed API for iterators and circulators to be used in hemesh.&lt;br /&gt;
Bascially, circulators seem to be iterators that allow access to the item you started iterating with--not necassarily the first item in a &amp;quot;list,&amp;quot; as the list can be circular (e.g. half-edges).&lt;br /&gt;
&lt;br /&gt;
Basically I'd like most of hemesh to use these iterator/circulator functions, including circulating the edges around a vert, circulating any extra solids around a vert (I &lt;br /&gt;
believe the proper term is inner boundary vertex holes, if I'm not mistaken, though I &lt;br /&gt;
may be), iterating through all edge-info structs (or half-edge pairs if we decide to&lt;br /&gt;
kill the HE_EdgeInfo struct), etc.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
typedef struct HE_Circulator {&lt;br /&gt;
	void *beginElem;&lt;br /&gt;
	void *data;&lt;br /&gt;
	/*-&amp;gt;next returns the next element, plus increments the&lt;br /&gt;
	  circulator to the next element too, same for -&amp;gt;prev*/&lt;br /&gt;
	void *(*next)(struct HE_Circulator *self);&lt;br /&gt;
	void *(*prev)(struct HE_Circulator *self);&lt;br /&gt;
	void (*dealloc)(struct HE_Circulator *self);&lt;br /&gt;
} HE_Circulator;&lt;br /&gt;
&lt;br /&gt;
typedef struct HE_Iterator {&lt;br /&gt;
	void *start;&lt;br /&gt;
	void *data;&lt;br /&gt;
	void *(*next)(struct HE_Iterator *self);&lt;br /&gt;
	void *(*prev)(struct HE_Iterator *self);&lt;br /&gt;
	void (*dealloc)(struct HE_Iterator *self);&lt;br /&gt;
} HE_Iterator;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=Proposed API for modifying the internal HE mesh=&lt;br /&gt;
&lt;br /&gt;
This is my new proposed API for handling mesh operations, HE_Operations.&lt;br /&gt;
It has it's own module prefix, HEOP, for HE Operations.&lt;br /&gt;
&lt;br /&gt;
Here is the code:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
/****************HALF-Edge Mesh Modifyer API***********&lt;br /&gt;
 *                                                    *&lt;br /&gt;
 *                                                    *&lt;br /&gt;
 * --Rules of using hemesh operations API:            *&lt;br /&gt;
 * NEVER CHANGE A THING about the data except for     *&lt;br /&gt;
 * flags and vertex coordinates. ESPECIALLY the       *&lt;br /&gt;
 * pointers!                                          *&lt;br /&gt;
 *                                                    *&lt;br /&gt;
 * Theres no point in creating a wrapper structure if *&lt;br /&gt;
 * it can be at all avoided. BUT this means no        *&lt;br /&gt;
 * modifying the mesh outside these functions! That's *&lt;br /&gt;
 * why TryMerge is in this API, just in case I'm      *&lt;br /&gt;
 * forced to use the hackish method of merging        *&lt;br /&gt;
 * *shudder*.                                         *&lt;br /&gt;
 ******************************************************/&lt;br /&gt;
 &lt;br /&gt;
/****************************************************&lt;br /&gt;
 *              Query Operations                    *&lt;br /&gt;
 ****************************************************/&lt;br /&gt;
&lt;br /&gt;
/*the all-important euler validation function,&lt;br /&gt;
  throws HE_NON_MANIFOLD if the mesh doesn't pass.*/&lt;br /&gt;
void HE_CheckEuler(HE_EditMesh *em)&lt;br /&gt;
&lt;br /&gt;
/*returns the first edge info in the mesh*/&lt;br /&gt;
HE_EditEdgeInfo *HEOP_getFirstEditEdgeInfo(HE_EditMesh *em)&lt;br /&gt;
&lt;br /&gt;
/*returns the first face in the mesh*/&lt;br /&gt;
HE_EditFace *HEOP_getFirstFace(HE_EditMesh *em)&lt;br /&gt;
&lt;br /&gt;
/*Note: all these vert-query functions return NULL-stopped arrays.*/&lt;br /&gt;
&lt;br /&gt;
/*returns a null-stopped list of the solids around a vert, using nice circular-vert &lt;br /&gt;
system.  the list is populated with half-edges, one for each incident disc.*/&lt;br /&gt;
HE_EditEdge **HEOP_getSolidsAroundVerts(HE_EditMesh *em, HE_EditVert *eve)&lt;br /&gt;
{&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
/*returns a null-stopped list of the edges around a vert*/&lt;br /&gt;
HE_EditEdge **HEOP_getHalfEdgesAroundVert(HE_EditMesh *em, HE_EditVert *eve);&lt;br /&gt;
&lt;br /&gt;
/*returns a null-stopped list of the faces around a vert*/&lt;br /&gt;
HE_EditFace **HEOP_getFacesAroundVert(HE_EditMesh *em, HE_EditVert *eve);&lt;br /&gt;
&lt;br /&gt;
/*returns a null-stopped list of the vertices around a vert*/&lt;br /&gt;
HE_EditVert **HEOP_getVertsAroundVerts(HE_EditMesh *em, HE_EditVert *eve);&lt;br /&gt;
&lt;br /&gt;
/*sets the variables pointer by the pointers to various mesh info, such as &lt;br /&gt;
  number of vert, number of edges (not counting half-edge duplicates), number&lt;br /&gt;
  of faces and the number of materials associated with the mesh.*/&lt;br /&gt;
void HEOP_getMeshInfo(HE_EditMesh *em, int *totface, int *totinfoedge, int *totvert, &lt;br /&gt;
int *totmat);&lt;br /&gt;
&lt;br /&gt;
/****************************************************&lt;br /&gt;
 *             Additive Operations                  *&lt;br /&gt;
 ****************************************************/&lt;br /&gt;
/*creates a vert inside of a face, triangulating? that face.&lt;br /&gt;
  retains the origional face as one of the new quads?.*/&lt;br /&gt;
HE_EditVert *HEOP_makeVertInFace(HE_EditMesh *em, HE_EditFace *efa, float co[3]);&lt;br /&gt;
&lt;br /&gt;
HE_EditVert *HEOP_makeVertInEdge(HE_EditMesh *em, HE_EditFace *efa, float co[3]);&lt;br /&gt;
&lt;br /&gt;
/*Slices a face between two edges.  Raises HE_INVALID_ARGUMENT if the edges&lt;br /&gt;
  are not on the same face.*/&lt;br /&gt;
HE_EditFace *HEOP_splitFaceBetweenTwoEdges(HE_EditMesh *em, HE_EditFace *efa, &lt;br /&gt;
HE_EditEdge *e1, HE_EditEdge *e2)&lt;br /&gt;
&lt;br /&gt;
/*Splits a series of connected edges off of a face, and forms a new one.&lt;br /&gt;
  returns the newly formed face.  Raises HE_INVALID_ARGUMENT if the edges&lt;br /&gt;
  are not adjacent and on the same face.*/&lt;br /&gt;
HE_EditFace *HEOP_splitEdgesOffFace(HE_EditMesh *em, HE_EditFace *efa, HE_EditEdge &lt;br /&gt;
**elist);&lt;br /&gt;
&lt;br /&gt;
/****************************************************&lt;br /&gt;
 *             Subtractive Operations               *&lt;br /&gt;
 ****************************************************/&lt;br /&gt;
/*Returns the newly formed face, which will likely simply be f1.*/&lt;br /&gt;
HE_EditFace *HEOP_joinAdjacentFaces(HE_EditMesh *em, HE_EditFace *f1, HE_EditMest *f2);&lt;br /&gt;
&lt;br /&gt;
/*This returns the new face created when the vert was removed*/&lt;br /&gt;
HE_EditFace *HEOP_deleteVert(HE_EditMesh *em, HE_EditFace *f1);&lt;br /&gt;
&lt;br /&gt;
/*This returns the new vert formed by the collapsed edge, which is really just edge-&amp;gt;v1*/&lt;br /&gt;
HE_EditVert *HEOP_collapseEdge(HE_EditMesh *em, HE_EditEdge *e1);&lt;br /&gt;
&lt;br /&gt;
/*Collapse a face*/&lt;br /&gt;
HE_EditVert *HEOP_collapseFace(HE_EditMesh *em, HE_EditEdge *e1);&lt;br /&gt;
&lt;br /&gt;
/*this attempts to merge geomerty with the flag &amp;quot;flag&amp;quot; set in the flag variable at &lt;br /&gt;
  index &amp;quot;flagvar&amp;quot;, and raises a NON_MANIFOLD_ERROR if unsuccessful.&lt;br /&gt;
  it works on a copy of HE_EditMesh, so it won't corrupt anything.&lt;br /&gt;
&lt;br /&gt;
  This operation is to faciliate a generic merge tool, and will likely&lt;br /&gt;
  be written to break down into euler ops (should be possible, although&lt;br /&gt;
  the more hackish way of brute-force merging the verts and then re-creating&lt;br /&gt;
  the editmesh may be faster (but that's a bad way of doing it).&lt;br /&gt;
  */&lt;br /&gt;
void HEOP_tryToMerge(HE_EditMesh *em, int flagvar, int flag);&lt;br /&gt;
&lt;br /&gt;
/****************************************************&lt;br /&gt;
 *             A Very Simple Error API              *&lt;br /&gt;
 ****************************************************/&lt;br /&gt;
 /*&lt;br /&gt;
  *This (really simple) error system is how hemesh passes *fatal* messages around.&lt;br /&gt;
  *So, if an operation borks and messess up the euler, HEOP_CheckEuler will&lt;br /&gt;
  *set an error.  In HEOP_tryToMerge, if it fails merging it will set an error&lt;br /&gt;
  *(which your supposed to catch).  In the case of HEOP_tryToMerge, it restores&lt;br /&gt;
  *a damaged mesh, but in most cases after an error you have to clear the error&lt;br /&gt;
  *stack and restore the mesh to a previous state.&lt;br /&gt;
  *&lt;br /&gt;
  *this is why I've left a more intact generic way of calling user tools in place;&lt;br /&gt;
  *it's transparent even to blender (much less a user), and it will allow catching&lt;br /&gt;
  *these errors.&lt;br /&gt;
  */&lt;br /&gt;
&lt;br /&gt;
int HEOP_CheckError(HE_EditMesh *em)&lt;br /&gt;
static char *he_error_string(HE_EditMesh *em)&lt;br /&gt;
char *HEOP_ErrorCodeToString(int code, HE_EditMesh *em)&lt;br /&gt;
int HEOP_CatchError(HE_EditMesh *em, int errorcode)&lt;br /&gt;
void HEOP_PrintErrorStack(HE_EditMesh *em)&lt;br /&gt;
void HEOP_RaiseError(HE_EditMesh *em, char *from_name, int errorcode) &lt;br /&gt;
/*str is NOT mem_freeN'd!*/&lt;br /&gt;
void HEOP_RaiseErrorString(HE_EditMesh *em, char *str);&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category:Meshes]]&lt;br /&gt;
[[Category:API's]]&lt;br /&gt;
[[Category:Script]]&lt;/div&gt;</summary>
		<author><name>wiki&gt;Terrywallwork</name></author>
		
	</entry>
</feed>