I was searching for a way to determine if a point is within a polygon and stumbled upon rm -rf's answer. (actually, I really wanted to find a point within a Rectangle
, but I won't be picky.)
The use of an undocumented function left me wondering about other possible functions that might be fun to play with. A look at
?Graphics`Mesh`*
Comes up with a number of functions that don't look like they have documentation. There has been some discussion on how to find undocumented options, but I'm wondering how to find out usage for undocumented functions. For example, CurveToPolygon
looks like it could be fun to play with but I have no idea what values to pass to it.
Information[Graphics`Mesh`CurveToPolygon]
Tells me something about the options and attributes, but if I try any of the following:
Graphics`Mesh`CurveToPolygon[
BezierCurve[{{-1, 0}, {-1, 2}, {1, 2}, {1, 0}}]]
Graphics`Mesh`CurveToPolygon[{{-1, 0}, {-1, 2}, {1, 2}, {1, 0}}]
Graphics`Mesh`CurveToPolygon[BezierCurve, {{-1, 0}, {-1, 2}, {1,
2}, {1, 0}}]
Graphics`Mesh`CurveToPolygon[{{-1, 0}, {-1, 2}, {1, 2}, {1,
0}}, BezierCurve]
The best I can learn is that the function takes 2 arguments.
I'm interested in knowing if there are ways to get at this information a priori or do I need to simply hang out with people who already know the answer?
Edit to address rm -rf comment I cut and pasted the code in Simon's answer into a new package, executed it, and when running:
Spelunk[Graphics`Mesh`CurveToPolygon]
I get the following output:
which is different from what I think is expected?
CurveToPolygon[Curve[data_], o : OptionsPattern[]] /; validPoly[data] ...?
CurveToPolygon
. If you do that, you'll see that it only takes one argument (and options), which must have the headCurve
. $\endgroup$