I’m trying to create a dim for a selected edge, but when the edge is not perpendicular or parallel to the axis, the error code is like this:
The error message tells you that the error happens in a method call when passing an argument to a vector parameter that cannot be coerced into a Geom::Vector3d
object. This happens on line 290 within the determine_dimension_offset()
method, likley in the else
clause …
else
offset_direction = camera_direction.cross(edge_direction)
offset = offset_direction.valid? && offset_direction.length > 0 ? offset_direction.normalize * offset_distance : Geom::Vector3d.new(0, 0, offset_distance)
end
So do some debugging and check all references there to be sure that they are vectors or arrays of 3 numeric values.
Sorry, I do not understand the Vietnamese comments.
offset_distance = 20
. . .
offset_direction.normalize * offset_distance
In the else clause the asterisk is operating on a vector making it a cross product operator. If you want to change the length of a vector then you can use the Vector.3d.length= method.