Is it follow_me or followme ?
-
I hope inconsistencies in the API are still being corrected!
I'm following the included example.
http://ruby.sketchup.com/Sketchup/Face.html#followme-instance_methodHowever Followme does not seem to like to turn 90 degree corners see the attached pic and code.
group=entities.add_group entities=group.entities #...1 followme profile face=entities.add_face @pt #...2 primary section profile used by follow-me line = entities.add_line(@ptT, @ptX, @ptY, @ptZ) #line color RED face=face.followme(line)
followme draws from @ptT, @ptX them ignores @ptY, @ptZ to finish wrapping around the remaining 2 lines ?
-
The added '_' in follwme is a typo in the API docs.
If you use .add_line(pt1, pt2) it returns 1 edge defined by those 2 points.
If you use .add_edges(pt1, pt2, pt3, pt4) it returns an array of 3 edges passing through those 4 points.In your example code because .add_line only reads the first 2 points it only makes 1 edge between them.
But with .add_edges and 4 points it will make the 3 edges expected... -
Thanks for your quick response TIG.
I recall having trouble distinguishing between edges and lines in the past, Its not something one always remembers. May I suggest adding a second example to the API for others looking for clarification
....again Thanks! -
It really ought have to been:
entities.add_edge(pt1, pt2)
and
entities.add_edges(pt1, pt2, pt3, pt4, ...)
BUT it's too late to change it now...
A Geom 'line' is something else all together -
defined by an array containing a point and a vector...
e.g.edge.line
-
@tomot said:
I hope inconsistencies in the API are still being corrected!
The place to log mistakes in the API Ruby documents are here:
https://github.com/SketchUp/ruby-api-docs/issues -
As TIG said, add_line was a deviance from what the norm. I think it got named like that because in the UI you have the "Line Tool". But in the API this is an unfortunate inconsistency.
And as Dan mentioned, please report documentation issues in the GitHub repo.
I queued up some cleanup to the followme method:
Advertisement