[ 
https://issues.apache.org/jira/browse/MATH-780?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13259080#comment-13259080
 ] 

Luc Maisonobe commented on MATH-780:
------------------------------------

Thanks for the new version. I was able to reproduce the problem. However, I 
don't understand what you are trying to achieve here.

In the double loop that creates the 2D SubLine instances, I have added some 
print statement to see the indices and the start and end points of the built 
lines. Here is the output I get:

{noformat}
idxA = 0, idxB = 2, idxC = 4
   adding SubLine: {1; -1} {-1; 1}
   adding SubLine: {-1; 1} {-1; 1}
   adding SubLine: {-1; 1} {1; -1}
idxA = 2, idxB = 4, idxC = 6
   adding SubLine: {-1; 1} {-1; 1}
   adding SubLine: {-1; 1} {-1; -1}
   adding SubLine: {-1; -1} {-1; 1}
idxA = 8, idxB = 14, idxC = 12
   adding SubLine: {1; -1} {-1; 1}
   adding SubLine: {-1; 1} {1; 1}
   adding SubLine: {1; 1} {1; -1}
idxA = 14, idxB = 12, idxC = 10
   adding SubLine: {-1; 1} {1; 1}
   adding SubLine: {1; 1} {-1; -1}
   adding SubLine: {-1; -1} {-1; 1}
idxA = 0, idxB = 8, idxC = 10
   adding SubLine: {1; -1} {1; -1}
   adding SubLine: {1; -1} {-1; -1}
   adding SubLine: {-1; -1} {1; -1}
idxA = 8, idxB = 10, idxC = 2
   adding SubLine: {1; -1} {-1; -1}
   adding SubLine: {-1; -1} {-1; 1}
   adding SubLine: {-1; 1} {1; -1}
idxA = 2, idxB = 10, idxC = 12
   adding SubLine: {-1; 1} {-1; -1}
   adding SubLine: {-1; -1} {1; 1}
   adding SubLine: {1; 1} {-1; 1}
idxA = 10, idxB = 12, idxC = 4
   adding SubLine: {-1; -1} {1; 1}
   adding SubLine: {1; 1} {-1; 1}
   adding SubLine: {-1; 1} {-1; -1}
idxA = 4, idxB = 12, idxC = 14
   adding SubLine: {-1; 1} {1; 1}
   adding SubLine: {1; 1} {-1; 1}
   adding SubLine: {-1; 1} {-1; 1}
idxA = 12, idxB = 14, idxC = 6
   adding SubLine: {1; 1} {-1; 1}
   adding SubLine: {-1; 1} {-1; -1}
   adding SubLine: {-1; -1} {1; 1}
idxA = 8, idxB = 0, idxC = 6
   adding SubLine: {1; -1} {1; -1}
   adding SubLine: {1; -1} {-1; -1}
   adding SubLine: {-1; -1} {1; -1}
idxA = 0, idxB = 6, idxC = 14
   adding SubLine: {1; -1} {-1; -1}
   adding SubLine: {-1; -1} {-1; 1}
   adding SubLine: {-1; 1} {1; -1}
lines.size() = 36
{noformat}

Once the 36 sublines have been created, one polygon is created from them.
It seems for each indices triplets, 3 lines are created representing a 
semi-infinite stripe. As they are all packed togeteher before building the 
single polygon, I guess the algorithm gets lots in all redundant boundary lines.

Are you sure the inner loop should build only 3 Subline instance and not 4, and 
are you sure only one polygon should be built from all these lines ?
                
> BSPTree class and recovery of a Euclidean 3D BRep
> -------------------------------------------------
>
>                 Key: MATH-780
>                 URL: https://issues.apache.org/jira/browse/MATH-780
>             Project: Commons Math
>          Issue Type: Bug
>    Affects Versions: 3.0
>         Environment: Linux
>            Reporter: Andrew Willis
>              Labels: BSPTree, euclidean.threed
>         Attachments: BSPMesh2.java, BSPMesh2.java, BSPMesh2.java
>
>
> New to the work here. Thanks for your efforts on this code.
> I create a BSPTree from a BoundaryRep (Brep) my test Brep is a cube as 
> represented by a float array containing 8 3D points in(x,y,z) order and an 
> array of indices (12 triplets for the 12 faces of the cube). I construct a 
> BSPMesh() as shown in the code below. I can construct the PolyhedronsSet() 
> but have problems extracting the faces from the BSPTree to reconstruct the 
> BRep. The attached code (BSPMesh2.java) shows that a small change to 1 of the 
> vertex positions causes/corrects the problem.
> Any ideas?

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to