-
-
Notifications
You must be signed in to change notification settings - Fork 380
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2458 from SiboVG/issue-2444
[#2444] Add Constrained Delaungay Triangulation for OBJ exporting
- Loading branch information
Showing
18 changed files
with
801 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
65 changes: 65 additions & 0 deletions
65
core/src/net/sf/openrocket/file/wavefrontobj/DefaultObjEdge.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
package net.sf.openrocket.file.wavefrontobj; | ||
|
||
public class DefaultObjEdge { | ||
/** | ||
* The vertex index of the start of this edge | ||
*/ | ||
private final int startVertexIndex; | ||
/** | ||
* The vertex index of the end of this edge | ||
*/ | ||
private final int endVertexIndex; | ||
|
||
/** | ||
* The normal index of the start of this edge | ||
*/ | ||
private final int startNormalIndex; | ||
/** | ||
* The normal index of the end of this edge | ||
*/ | ||
private final int endNormalIndex; | ||
|
||
/** | ||
* The texture coordinate index of the start of this edge | ||
*/ | ||
private final int startTexCoordIndex; | ||
/** | ||
* The texture coordinate index of the end of this edge | ||
*/ | ||
private final int endTexCoordIndex; | ||
|
||
|
||
public DefaultObjEdge(int startVertexIndex, int endVertexIndex, int startTexCoordIndex, int endTexCoordIndex, int startNormalIndex, int endNormalIndex) { | ||
this.startVertexIndex = startVertexIndex; | ||
this.endVertexIndex = endVertexIndex; | ||
this.startTexCoordIndex = startTexCoordIndex; | ||
this.endTexCoordIndex = endTexCoordIndex; | ||
this.startNormalIndex = startNormalIndex; | ||
this.endNormalIndex = endNormalIndex; | ||
} | ||
|
||
public static DefaultObjEdge[] createEdges(DefaultObjFace faces) { | ||
DefaultObjEdge[] edges = new DefaultObjEdge[faces.getNumVertices()-1]; | ||
for (int i = 0; i < faces.getNumVertices()-1; i++) { | ||
int startVertexIndex = faces.getVertexIndex(i); | ||
int endVertexIndex = faces.getVertexIndex((i + 1)); | ||
|
||
int startNormalIndex = -1; | ||
int endNormalIndex = -1; | ||
if (faces.containsNormalIndices()) { | ||
startNormalIndex = faces.getNormalIndex(i); | ||
endNormalIndex = faces.getNormalIndex((i + 1)); | ||
} | ||
|
||
int startTexCoordIndex = -1; | ||
int endTexCoordIndex = -1; | ||
if (faces.containsTexCoordIndices()) { | ||
startTexCoordIndex = faces.getTexCoordIndex(i); | ||
endTexCoordIndex = faces.getTexCoordIndex((i + 1)); | ||
} | ||
|
||
edges[i] = new DefaultObjEdge(startVertexIndex, endVertexIndex, startTexCoordIndex, endTexCoordIndex, startNormalIndex, endNormalIndex); | ||
} | ||
return edges; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.