Problem with imported geometry.
-
I am having an issue with some imported geometry.
When exploded down, my models faces combine to form a surface with smoothed rounded edges.
I don't want this.I tried this...
entities.grep(Sketchup::Edge).each{|e| e.smooth=false;e.soft=false;e.hidden=false }
But the above takes a long time and often crashes SU.I found this in the API...
smooth_flags = Geom::PolygonMesh::NO_SMOOTH_OR_HIDE
It looks like something added for 2014 release?
I am trying to figure out how I can apply this to my exploded geometry, if at all.
Any possible solution would be appreciated. -
@skastafari said:
I am having an issue with some imported geometry.
When exploded down, my models faces combine to form a surface with smoothed rounded edges.
I don't want this.Are you using a SU version older than SU2016? There has been a long standing bug which got fixed in SU2016. Previously you might find that under Windows, if SU did a slow operation it might some tiems apply soft+smooth to your selection. Explode is an example of such an slow operation. If this is the case you could perform an undo right afterward and that would correct the unwanted soft+smooth.
-
I tried using an array similar to how John suggested, but get no method error on smooth=, I am not sure what causes that. If I undo the the explode, sure It gets rid of the smooth, hide, & soft, but it also brings back the group I don't want. What I really want is to explode with the smooth, hide etc. set to false. It seems like it is on by default? I tried 2016 and got the same problem. The geometry is coming from an OBJ file using Simlab importer. The method I have works, but takes too long and is too unstable to use productively. I have a lot of models to process. I do appreciate the help any other ideas?
-
sorry I should have tested my snippet...
needs edges[0].each to get inside the array...
I'll edit it above...
-
collect your edges, then run the loop on the collection...
entities = Sketchup.active_model.active_entities # or whatever edges = [] # add empty array t1 = Time.now edges << entities.grep(Sketchup;;Edge) # add edges to the empty array edges[0].each{|e| e.smooth=false;e.soft=false;e.hidden=false } # process the array items p Time.now - t1 # get a timing to compare with your other method
john
-
It's okay John, The result was the same... 8-10 minutes of beach ball followed by either my desired result or a bug splat; toss a coin. What is this used for in API ?..
smooth_flags = Geom::PolygonMesh::NO_SMOOTH_OR_HIDE
Is there a way to use this setting on a array? -
are you on a mac now?
you should update your profile as it makes a difference...
do you import with materials?
can you share a smallish .obj file?
I may be able to suggest an alternate approach on a mac [that's all I use]...
john
-
Honestly John, it is not going to matter. I was trying to get useful geometry from Simlab's OBJ importer, but I am afraid I may have to drop it like a bad habit. There are other issues like the creation of tens of thousands of component definitions that emerge when groups are exploded. I do appreciate all the help I have got here. Thanks for making this community so awesome.
-
Jim's Mesh Importer plugin brings in skps that are converted from obj files externally, it's very quick, items fully triangulated [no soft, smooth hidden] but, has no texture...
john
-
Yeah, Jim's was kind of ground breaking for the day. I liked Tig's rework with textures, but I still had enough mesh trouble to make it not worth the trouble. I am importing whole house floor plans, and need groups to come in correctly to sort fixtures and the like. This is fairly large scale, over a hundred a week. I don't have a lot of room for error. SimLab offered groups, but when exploded, they turn to components named geom or something. I can easily end up with 70,000 plus unwanted component definitions, so no go with the long purge times. I had a custom build of fluid importer, but it is no longer supported. It looks like fluid obj importer might have a pro version coming out, so I might go that route instead. Thanks
-
Jim's was updated to use Assimp and the external SU C++ SDKrecently in the last 3 months...
just sayin...
john
Advertisement