Pointcloud - Joining the Dots
-
The attached file will hopefully illustrate what I'm trying to achieve. (Please ignore my ridiculous scale)
The Point-cloud consists of six individual Point-clouds of 360 points. Each describing the inner or the outer edge of an ellipse resulting in three different, flat elliptical rings.
The intention is to create a solid ring from these, two representing the side of the solid and the remaining, the middle. It is the edge forms of this solid ring that I wish to achieve, more quickly than I have been able.
The 'stitching' that I have done in the attached file joins the outer points n together and similarly the inner points n.
The edge form is covered (triangulated) by joining sides n to middle n+1 from 0 to 180 and by joining sides n to middle n-1 from 181 to 360.
Having articulated this, I realise now, that this could be coded but I have no knowledge how it might be dome.
-
This could be coded - sdmitch is probably on to it as I type!
The 'manual' way can be done much easier if you subgroup the cpoints in sets and overdraw them.
Then use a tool like CurviLoft or EEbyRails on the 'face's edges/curves to make individual meshes for each of the four faces of the ring [the centerline seems superfluous??]
-
What defines the 3rd ring?
I used this code to triangulate two of them after I figured out how they were ordered in the model.
mod = Sketchup.active_model ent = mod.entities sel = mod.selection # collect the construction point locations in groups of 360 pts=[];ring=[] ent.each{|e| if e.class==Sketchup;;ConstructionPoint ring<<e.position if ring.length>=360 pts<<ring; ring=[] end end } # triangulate the rings for i in 0...360 ent.add_face(pts[0][i],pts[2][i-1],pts[2][i]) ent.add_face(pts[0][i],pts[0][i-1],pts[2][i-1]) ent.add_face(pts[0][i],pts[4][i-1],pts[4][i]) ent.add_face(pts[0][i],pts[0][i-1],pts[4][i-1]) ent.add_face(pts[1][i],pts[3][i-1],pts[3][i]) ent.add_face(pts[1][i],pts[1][i-1],pts[3][i-1]) ent.add_face(pts[1][i],pts[5][i-1],pts[5][i]) ent.add_face(pts[1][i],pts[1][i-1],pts[5][i-1]) end
-
The central ring isn't superfluous. It was unfortunate that I chose the 0/360 point to example my triangulation as both the inner and outer edge forms show little cross sectional form at this point unlike at 90. The inner edge form's concave, the outer, convex.
I'm not at home as I write. I will use your ideas as soon as I can though. Unfortunately, I've not the first idea how to code. Thank you
-
Thank you Sam!
Not having done any coding, would you mind telling me how I can use the code that you've made?
-
It needs to be included in a method and a module to identify and isolate it from the other plugins that may be loaded. I have made the necessary additions to allow you to copy the plugin to the plugins folder and have it appear in the plugins menu.
Please understand that this plugin, as written, applies to this single case only and the construction points near the model origin must be deleted before the plugin is run so that there are only the 2160 construction points that define the 6 rings.
-
This is some what off topic so please delete if not correct;
I attempted to convert skp file to dae and then see what MeshLab does with the data but it appears dae does not convert cpoints and only the vertices are showing??
There is a plugin to go from vertex to cpoint. Is there one for the cpoint to vertex?? -
My guess is no because you would have lost the relationship between the vertices that have been converted to construction points.
-
@sdmitch said:
It needs to be included in a method and a module to identify and isolate it from the other plugins that may be loaded. I have made the necessary additions to allow you to copy the plugin to the plugins folder and have it appear in the plugins menu.
Please understand that this plugin, as written, applies to this single case only and the construction points near the model origin must be deleted before the plugin is run so that there are only the 2160 construction points that define the 6 rings.
While trying not to appear stupid, I must ask what you mean by '......included in a method and a module and isolate it from other plugins....
...... would you mind explaining as if I am?
-
In Ruby, sub-routines are refered to as methods and are defined by "def method_name" as the first line and "end" as the last line. Modules contain any number of methods and are defined by "module Module_Name" as the first line and "end" as the last line. When a method is placed inside a module, it is normally coded def self.method_name where self. refers to the module containing it. Two modules can contain methods with same name but do different things and there is no conflict because the modules will have different names.
You should get a Ruby programming reference book if you ever expect to read and understand what the various code statements mean.
Advertisement