specifying faces which have a common edge

Sep 15, 2019 at 5:19pm
I have an output file, like beneath:

1
2
3
4
{6,<1,-1,-1>,<1,-1,0.5>,<1,-0.75,1>,<1,0.75,1>,<1,1,0.5>,<1,1,-1>}    
{6,<1,-1,-1>,<-1,-1,-1>,<-1,-1,0.5>,<-0.75,-1,1>,<0.75,-1,1>,<1,-1,0.5>}    
{4,<1,-1,-1>,<1,1,-1>,<-1,1,-1>,<-1,-1,-1>}    
{4,<1,3,-1>,<1,1,-1>,<1,1,0.5>,<1,3,0.5>}   


the first number indicates the number of folds of a polygon (in above example 4- and 6-sided polygon). the number between <> demonstrate the coordination of its vertex of that face.

Now, I wanna to write a code that reads line by line, then specifies faces having two common vertices, and eventually gives an output almost like bellow (which is obtained by the first and third line of previous output):

 
<1,-1,-1>,<1,1,-1> 6,4   


I would appreciate for any help.
Sep 16, 2019 at 5:21am
So what's the problem you're facing?

How to read a line?

How to split a line into things like?
int nPoints = 6;
string p = "<1,-1,-1>";


How to store the points in such a way that you know "<1,-1,-1>" is common between two polygons?

In short, you need to show how much you can achieve yourself, and ask a specific question about how you are stuck and what you want to achieve.

Don't just dump your assignment and expect complete code.
Last edited on Sep 16, 2019 at 5:22am
Sep 16, 2019 at 5:30am
I wanna to write a code

So what's stopping you? You have the parameters, writing code should be easy.

Expecting others to do all the work, well, that can get expensive.
Sep 16, 2019 at 7:16am
thanks "salem c" for your comments

I'm sorry because I did not specify my question
my question is (how can I just select a bracket?) so that I search it in text.
for example, storing the first bracket of first line : <1,-1,-1>

thank you
Last edited on Sep 16, 2019 at 7:29am
Sep 16, 2019 at 7:52am
Topic archived. No new replies allowed.