Is it possible to extract node locations from a STL file? - stl

I have 3D scanned wheel geometries of deformed tyres in an STL file format, and I would like to be able to do geometric analysis on them. One way I am familiar with is using the node locations to extract the information I am looking for.
I however cannot find a way to do this. If there is a program which can be used to analyse the geometry of STL files that would also be useful.

Related

What is the format for the training/testing data for a Computer Vision model

I am trying to build a CV model for detecting objects in videos. I have about 6 videos that have the content I need to train my model. These are things like lanes, other vehicles, etc. that I’m trying to detect.
I’m curious about the format of the dataset I need to train my model with. I can have each frame of each video turn into images and create a large repository of images to train with or I can use the videos directly. Which way do you think is better?
I apologize if this isn't directly a programming question. I'm trying to assemble my data and I couldn't make up my mind about this.
Yolo version 3 is a good starting point. The trained model will have a .weight file and a .cfg file which can be used to detect object from webcam, video in computer or, in Android with opencv.
In opencv python, cv.dnn.readNetFromDarknet("yolov3_tiny.cfg", "CarDetector.weights") can be used load the trained model.
In android similar code,
String tinyYoloCfg = getPath("yolov3_tiny.cfg", this);
String tinyYoloWeights = getPath("CarDetector.weights", this);
Net tinyYolo = Dnn.readNetFromDarknet(tinyYoloCfg, tinyYoloWeights);
Function reference can be found here,
https://docs.opencv.org/4.2.0/d6/d0f/group__dnn.html
Your video frames need to be annotated with a tool that generates bounding boxes in yolo format and there are quite a few available. In order to train custom model this repository contains all necessary information,
https://github.com/AlexeyAB/darknet

GeoMesa: saving raster data

How can I save in GeoMesa raster data (GeoTIFF, DEM)? Can you please provide code examples? Also, please provide info (links) to the serialization of the raster data in Accumulo
I have only found the following commands line tool:
http://www.geomesa.org/documentation/user/accumulo/raster.html#ingest
http://www.geomesa.org/documentation/user/accumulo/commandline_tools.html#accumulo-tools-raster
http://www.geomesa.org/documentation/tutorials/geomesa-raster.html
Moreover, can I read that the image should be an image pyramid EPSG:4326 in order to ingest it. What will happen if it is not? Will I not be able to ingest it or the image will not be available in multiple zoom levels?
Since the GeoMesa raster module isn't heavily used, sadly there are few examples around writing data to Accumulo using it. That said, I believe you are looking for the 'putRaster' method here [1].
I believe the data must be pre-tiled to be ingested. If it is not pyramided, then only the one zoom level will be ingested. The benefit of the pyramid is for quicker downsampling; if that's not a concern, then no worries!
https://github.com/locationtech/geomesa/blob/master/geomesa-accumulo/geomesa-accumulo-raster/src/main/scala/org/locationtech/geomesa/raster/data/AccumuloRasterStore.scala#L193

convert multiple files from .LWO to .OBJ or similar

I need to convert many files from .lwo format to .obj or .stl. I have too many to convert "by hand", meaning I don't want to use online tools or import/export the files one by one in Blender or similar.
So I'm trying to do so with a program that would load up each file, convert, then save a new stl . The files are numbered "file000001", "file000002", etc. to make importing easier.
Is there any program out there that will do this? If not, how would I go about accomplishing my goal?
As far as languages go, I am most effective with Processing/Java. I found this which might be similar but doesn't relate to LWOs.
Thanks for any help.
I just found assimp which has a command line tool to convert different file types. Thanks everyone who answered!
I'm sure you can find a few editors that import .lwo and export .obj
For example, Wings3D does that and free/opensource/lightweight.
Wings is scriptable using erlang.
Blender has LWO importer too, but it's not enabled by default. you need to go to Preferences > Addons and enable it there:
Blender has a Python API which should be easy to pickup.
This would allow you to write a script that does a batch conversion (reads a directory, traverses files, imports .lwo, transforms (scales/rotates if needed), exports .obj)
Perhaps if you search enough maybe there is a 3d file format batch converter already out there and .lwo/.obj are old enough formats so might be likely to be supported.
If you want to implement something from scratch, you need to look into each file format (e.g. lightwave object, obj ) to be able to parse and export.
Hopefully there's a java library that for you. I'd start with a 3D java game engine. For example here's a java .LWO importer found via JMonkey.

Convert and add obj model to Web gl scene - without three.js

I want someone to tell me the steps to follow to convert an .obj object to json object so I can add it to my web gl scene like this : http://learningwebgl.com/blog/?p=1658
I ve tried everything. Python script, online converters etc. Every one has its flaws and I can't fix them.
I don't use the three.js lib.
Why can't you fix them?
There is no simple answer for how. The format for .obj is documented here. Read it, pull the data out you want in a format you design.
There's an infinite number of ways to convert it and an infinite number of ways to store the data. Maybe you'd like to read out the data and store the vertices in JavaScript arrays. Maybe you'd like to store them in binary which you download with XHR. Maybe you'd like to apply lossy compression to them so they download faster. Maybe you'd like to split the vertices when they reach some limit. Maybe you'd like to throw away texture coordinates because your app doesn't need them. Maybe you'd like to read higher order definitions and tessellate them into triangles. Maybe you'd like to read only some of the material parameters because you don't support all of them. Maybe you'd like to split the vertices by materials so you can more easily handle geometries with multiple materials. Maybe you'd like to reindex them so you can use gl.drawElements or maybe you'd like to flatten them so you can use gl.drawArrays.
The question you're asking is far too broad.

How to aggregate points with same value into polygons from a shapefile using GDAL or any other opensource solution

I have a shapefile with around 19,000 points. Its basically export from a raster. Now i need to extract polygons, by aggregating the points which have same value.The field who's value i am going to use for aggregation is dynamically calculated each time using the elevation of points. NOw i need to spit out polygons. How can I do that using GDAL? is there a utility to do it. Any other opensource solutions are welcome.
I have ArcGIS which has a toolbox called 'Aggregate Points' but somehow licence for it is missing.
Here are some possibilities:
You can write a program using GDAL (actually OGR) in C++ or Python (or any other language for which GDAL/OGR provides bindings) and construct Polygon objects from the selection (sub-sets) of your points. Then you can serialise those polygons in to Shapefile or anyother storage supported by OGR.
Alternatively, forget about GDAL/OGR and load your data into PostgreSQL database enabled with PostGIS. Then use PostGIS functionality to construct Polygons
There is example of polygon construction from points based on bruteforce string manipulation and use of geometry constructor posted as postgis-users thread Making a Polygon from Points