The three points are coplanar and are non-linear i.e. they define a proper plane. The only problem seems to be the fact that they are relatively close to each other because the exception goes away when I multiply all the coordinates by 1000 and add the facet.
In this case the exception is misinforming the actual cause.
Has anyone come across this before and found some form of workaround?
Everyone has come across it. SketchUp fails to create faces at small scales typically when edges are near 0.001 inch or smaller. The work-around is model large then scale down.
Search this forum for the problem and you will get many results including explanations and work- around workflows.
The error is misleading because ANYthree points should always be “coplanar”.
You can of course force that message with four points where one in not coplanar.
However, if two [or all] of these three points are deemed coincident [because of the 1/1000" tolerance issue] then you do NOT have three distinct and separate points.
But in that case the error should be:
Error: #<ArgumentError: Not enough points - at least 3 required>
But it seems that the check for the validity for the number of points is preempted by the flaky coplanar check.
I would hope for a slightly better message string, like:
Error: #<ArgumentError: Not enough valid points - at least 3 non-coincident points required (having minimum 0.001" spacing.)>
… or it is “having co-ordinates” that differ by 0.001" ?
I would really prefer new custom exception classes that are easier to write rescue clauses for.
This kind of error is most similar to a FloatDomainError in behavior, but IMO should not be it’s subclass.
Like FloatDomainError, this error should probably be a subclass of RangeError. This would be proper to raise when a value or object does not “fit” within some range or set.
I would (if it were my call,) define such geometry creation errors with the API’s Geom module.
So some API-specific exceptions that would be beneficial: