magneto Posted September 18, 2012 Share Posted September 18, 2012 (edited) Hi, If you want to make an asset that's only meant for curves, can you filter out the incoming geometry to only work on the curves? I know curves are abstracted to be primitives but I don't know any way to know whether a primitive is a polygon, a NURBS surface or a curve. Is there a way to group only curves in a group and leave out everything else? Thanks Edited September 18, 2012 by magneto Quote Link to comment Share on other sites More sharing options...
Macha Posted September 18, 2012 Share Posted September 18, 2012 You could check area and mapv. 1 Quote Link to comment Share on other sites More sharing options...
magneto Posted September 18, 2012 Author Share Posted September 18, 2012 Thanks Macha, that's an interesting trick. But would the area method work if the curve is closed? Quote Link to comment Share on other sites More sharing options...
eetu Posted September 18, 2012 Share Posted September 18, 2012 Umm, the Group SOP has filters for primitive type? If you need to catch all curve types, make a group for each curve type and combine them (combine tab in group sop) 1 Quote Link to comment Share on other sites More sharing options...
Macha Posted September 18, 2012 Share Posted September 18, 2012 You could also give it a type when you create the curves, with a string attribute. Quote Link to comment Share on other sites More sharing options...
tjeeds Posted September 18, 2012 Share Posted September 18, 2012 Umm, the Group SOP has filters for primitive type? Don't think you can differentiate between a polygon and a polycurve though. This is an interesting problem, I think the basic solution is to find primitives where the first and last vertex are not in the same position, right? 1 Quote Link to comment Share on other sites More sharing options...
magneto Posted September 18, 2012 Author Share Posted September 18, 2012 (edited) Thanks Macha, I wouldn't have control over the creation of the curves because the asset will accept curves to modify but not create them from scratch. Wow Eetu I didn't notice the Primitive filters, that solved the problem. Thanks alot EDIT: tjeeds, you are right, if it's a polygon curve then it doesn't see them as curves. That's interesting. EDIT2: I just tried but even MAPU doesn't work if it's a polygon curve, so they all return 0 for u. Edited September 18, 2012 by magneto Quote Link to comment Share on other sites More sharing options...
zarti Posted September 18, 2012 Share Posted September 18, 2012 (edited) case is solved but a new question was born =) : what is a polycurve ? -- edit : got it ! example : Curve SOP drawing in polygon mode .. =) in this case to separate a poly-curve from a usual poly , a Measure SOP measuring the ' area ' should do its job . the poly-curve must have its area attribute value equal to Zero . No ? Edited September 18, 2012 by zarti Quote Link to comment Share on other sites More sharing options...
magneto Posted September 18, 2012 Author Share Posted September 18, 2012 If the curve is closed, then the area will not be 0 1 Quote Link to comment Share on other sites More sharing options...
zarti Posted September 18, 2012 Share Posted September 18, 2012 can you upload an example ? =) Quote Link to comment Share on other sites More sharing options...
magneto Posted September 18, 2012 Author Share Posted September 18, 2012 Here you go polycurve.hip Quote Link to comment Share on other sites More sharing options...
zarti Posted September 18, 2012 Share Posted September 18, 2012 Here you go thanks ! i see a polygon . =) Quote Link to comment Share on other sites More sharing options...
magneto Posted September 18, 2012 Author Share Posted September 18, 2012 Perhaps there is no difference between a polygon and a polycurve then, whether it's open or not? Quote Link to comment Share on other sites More sharing options...
zarti Posted September 19, 2012 Share Posted September 19, 2012 Perhaps there is no difference between a polygon and a polycurve then, whether it's open or not? example you uploaded ( should ) behave/s like a polygon ( or primitive , like they are called in houdini ) . if you 'shoot' a point towards it , it will collide .. ( very probably somewhere not over the 'curve' ) . if you use a clip SOP it will be cut . an extra line , connecting two or more points of the 'curve' , will be created out of nothing . .. and so on . -- { show me waht you do , so i can tell you who you are } =) now , polygon and polycurve or whatever are just names , conventions . what matters are how their content behaves like . thats what defines those better , IMHO . personally , i do not even agree the term polycurve does make any sense at all ( ?! ) . because curve manifests another very clear attribute : curve:a. A line that deviates from straightness in a smooth, continuous fashion. b. .. - polypath ? - maybe .. =) 1 Quote Link to comment Share on other sites More sharing options...
magneto Posted September 19, 2012 Author Share Posted September 19, 2012 Thanks zarti, good points. I think the main distinction comes when it's looked at as a collection. A string of polygons, whether closed or open, can be thought as a curve, which would a be single closed polygon if the curve is closed. But if the polygons share edges like in a grid or box, then those shouldn't be seen as polygonal curves. So in this regard, if the curve is open, doesn't matter if it's polygon or nurbs, but if it's closed, only isolated singular polygons should be included in the group. Something like this: Can this be done? Quote Link to comment Share on other sites More sharing options...
Macha Posted September 19, 2012 Share Posted September 19, 2012 Use the duck test. If it looks like a duck and quacks like a duck it probably is a duck. A curve is one-dimensional and a surface is 2 dimensional, so you can tell that from its uv values. And whether it is poly or nurbs, you can probably tell from how it behaves when the direction changes; is it smooth or stepped. You just build a selection of tests like these to distinguish your ducks from your geese and you should be fine. And, isn't there a python thing that gives you the type of an object? Quote Link to comment Share on other sites More sharing options...
Macha Posted September 19, 2012 Share Posted September 19, 2012 And if you want that a bit more formal: http://en.wikipedia.org/wiki/Duck_typing Quote Link to comment Share on other sites More sharing options...
magneto Posted September 19, 2012 Author Share Posted September 19, 2012 Do you mean the isspline expression? It returns false for polygonal splines. I know duck typing. For my tests I just need to see if a point is shared by more than 2 edges/faces. That should separate multi polygon objects from single polygons. Unless there is a simpler way to detect singular polygons Quote Link to comment Share on other sites More sharing options...
zarti Posted September 19, 2012 Share Posted September 19, 2012 does this method performs good enough for your case ? im on a laptop manufactured on 2005 . =) -- gotUniquePoliez.hipnc -- Quote Link to comment Share on other sites More sharing options...
magneto Posted September 19, 2012 Author Share Posted September 19, 2012 Thanks zarti, I was suspecting it might be the partition sop. Your solution should do it Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.