Is there any good solution about the accuracy issue caused by scaling?

tr_arr = [4.8364636603358906e-09, 1.377460047609002e-11, 0.018500680967125094, 0.0, 0.026387430624252976, 7.515328429044587e-05, -3.3909277664520265e-09, 0.0, -5.166779173874384e-05, 0.04901591274040792, -4.2722038991268865e-17, 0.0, 8509.194934285286, -19763.790146299514, -478.77437297581986, 1.0]
trans = Geom::Transformation.new(tr_arr)
plane1 = [Geom::Point3d.new(0, 6905.33, 0), Geom::Vector3d.new(-0, -1, -0)]
plane2 = [Geom::Point3d.new(7721.26, 6905.33, 0), Geom::Vector3d.new(-0, -1, -0)]

puts "same:#{plane1[1].samedirection?(plane2[1])}  dis:#{plane1[0].distance_to_plane(plane2)}"

plane1.map! { |pt| pt.transform(trans.inverse) }
plane2.map! { |pt| pt.transform(trans.inverse) }


puts "same:#{plane1[1].samedirection?(plane2[1])}  dis:#{plane1[0].distance_to_plane(plane2)}"
same:true  dis:0.0
same:true  dis:124.30154003680218

It appears that the transformation matrix is ever so slightly non-orthogonal; i.e. the axes of the transformation are not perpendicular to each other. This results in a systematic skewing of the points and planes that are being calculated. How was the transformation created?

Here’s a bit of code showing the details.

Inspect transformation.rb (1.1 KB)

I cannot confirm how it occurred; it may have been caused by the imported third-party model