Jump to content

cleaning traced letter line


Follyx

Recommended Posts

interesting problem: traced a single letter. I want to convert it for further development in exactly ONE line. Sounds easy. Isnt it. Is it? Tried a lot of different ways as you can see in the attached file. Probably I dive into with the wrong Idea... We'll see. Would be nice if you could gime some hints. Llatest with a new resample sop the real problem appears...

 

 

single_line.hip

Edited by Follyx
Link to comment
Share on other sites

hm, spent  the half night for using this approach. But this way is a new terrain for me and I dont find a good entrance. Its highly interesting. Unluckily precisly the min-max-average sop is without examples on the site. Would you mind to setup a small file with the approach you have described? That would help a lot.

Definetely you waked up my interest with your reference from growth and form in this theme. Even if I'm a bit helpless with your file. Wich part of it is usable for my specific problem? Jesus, or thank god, learning with Houdini never stops, lol. Thank you in advanced.

Olly

Edited by Follyx
Link to comment
Share on other sites

@Follyx  :wub:
Contour line 0.5

int drawLine(vector f; vector t){
    int base=addpoint(0,f);
    int to=addpoint(0,t);
    int line=addprim(0,"polyline",base,to);
    return line;
}
//-----------------------------

int read=0;
if(npoints(1)>0){
    read=1;
}

int maxLines=chi("maxLineCount");
float minLen=chf("minLineLength");

int pts[]=pcfind(read,"P",v@P,chf("maxLineLength"),chi("maxFindCount"));
int randomConnect=chi("randomConnect");
int keepPointCount=min(1, max(0,chi("keepPointCount")));
int runner=0;
vector curPos;
int pt;
if(randomConnect == 0){
    for(int x=0; x<len(pts);++x){
        pt=pts[x];
        
        if(runner > maxLines){ break; }
        
        curPos=attrib(read,"point", "P", pt);
        if(length(curPos-v@P)>minLen && (@ptnum<pt || read)){
            if(keepPointCount){
                int to=pt;
                if(read){
                    to=addpoint(0,curPos);
                }
                addprim(0,"polyline",@ptnum,to);
            }else{
                drawLine(v@P,curPos);
            }
            runner++;
        }
    }
}else{
    int l=len(pts);
    float fl=float(l);
    int rander=pts[int(random(@ptnum*fl+randomConnect)*fl*fl) % l];
    curPos=attrib(read,"point", "P", rander);
    if(keepPointCount){
        int to=rander;
        if(read){
            to=addpoint(0,curPos);
        }
        addprim(0,"polyline",@ptnum,to);
    }else{
        drawLine(v@P,curPos);
    }
}


Have Fun investigate

 

1477.jpg

Edited by Librarian
  • Like 1
Link to comment
Share on other sites

ok, found a solution. But I want to try it on a conventional way. The solution in the file in the green Networkbox works for further purposes. But I am solid interested how to get that without the LAB Sop. In the red netwokbox the solution is not so far but here is now a problem with pointsorting. I let all the tried nodes in the file so you can see what I already tried to try.

Hopefully there is an easy solution with the standard nodes as well. My Brain is working just to complicated today ;-)

The Solution from librarian is for sure very professionel and I am also super interested in. But before I need a fast kick, wich I understand now, for furher development of the project.

So thanky you in advance

 

letter_single_line.hip

 

 

Edited by Follyx
  • Like 1
Link to comment
Share on other sites

thread was splitted unfortunately: second corresponding thread:

well, after trying to elaborate for hours again at least I dont get a solution. Of course I could dissolve the surplus edges and points ( in this case edges) but I realy look forward to find a complete procedural way. Also the last file from yours  have double edge at the ends. And I have to look forward to get a exacter aproxiamtion to the center for the line. Nevertheless I really learned a lot from your tips and approach and still examine in this direction.

But the annoying "S" is still bugy. If it would need only this single letter I would say well... Although my interest would not be satisfied. But in this case it becomes eventually a lot of letters from hundreds of different people so it has to be watertight.

Any  more suggestion and/or tips Librarian and/or other? I am at my wit's end.

Thanks in advance

 

 

 

 

single_lineFix1-5.hiplc

Edited by Follyx
Link to comment
Share on other sites

after studying this "easy" problem with first class help from librarian I analyzed the straight-skeleton-2d-SOP from SideFX Labs wich follows a similiar approach for the solution. Nice to have a node wich do the job for me. Better to have a person, librarian in this case, wich shows up similiar approaches and more or less assist in learning the substance. So the offals of the corresponding node, if there is one, is completely understandable.

Problem solved with a lot of new knowledge. Great.

 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...