According to Point3d class definition documentation the ‘+’ operator should be used to perform vector addition upon two Point3d objects. However, the interperator generates a run time error with the message that a Vector3d object is expected. This equates to
p2 = p1 + v
which is the same as
p2 = p1.offset(v)
This should be flagged as an error since the functionality is at odds with the class definition.
Vector addition of Point3d objects is useful for finding the average of a group of Point3d objects.
i.e.
avg = Geom::Point3d.new
pts.each{|p| avg = avg + p} # pts is an array of Point3d
n = 1.0 / pts.count
t = Geom::Transformation.scaling(n,n,n)
avg.transfom!(t)