I have a cloud point taken with my iPhone and I exported to a txt file with all the points.
The txt file contents somethig like this:
0.4400,0.2284,-5.0440
0.4575,0.2299,-5.0422
0.4666,0.2298,-5.0432
0.4701,0.2288,-5.0401
0.4592,0.2300,-5.0404
0.4684,0.2300,-5.0469
0.4735,0.2300,-5.0465
0.4832,0.2304,-5.0459
0.4957,0.2310,-5.0458
0.5261,0.2307,-5.0441
0.5342,0.2318,-5.0453
0.5480,0.2386,-5.0401
0.5576,0.2378,-5.0449
I work with sketchup for mac so I can’t use Sketchup Essentials extension.
I tried this but it’s a lot of information and sketchup crash
class String
def numeric?
Float(self) != nil rescue false
end
end
model = Sketchup.active_model
entities = model.active_entities
File.foreach(UI.openpanel("Open Text File", "c:/", "Text Files|*.txt||")) { |line|
a = line.split(',')
if a[0].numeric?
point1 = Geom::Point3d.new(a[0].to_f,a[1].to_f,a[2].to_f)
constpoint = entities.add_cpoint point1
end
}
Is there a better way to draw a point? I couldn’t imagine that drawing a point could be so difficult.
I’m attaching the original file in case someone needs it.
Untitled_Scan_08_11_02.txt (15.3 MB)