[REQ/Q?] Flattening and exporting scenes as skp files.
-
i probably don't understand everything that is written here, and this probably too simple for you, but what about:
setting the camera in the sky downwards for each scene
making a screenshot of each scenethis would give you pictures you could import in sketchup or layout (i am not sure for Layout), and you could draw on them
-
The issue is a bit more complicated than that.
Architects using sketchup need an easy workflow to convert their 3d models into accurate drawings, to represent buildings and to share with consultants.
The workflow involves 3d modelling of the most important parts, 2d drawing that is extracted from 3d,and 2d drawings that complement those and are still accurate
usually the later are done in cad, but I do them in layout or sketchup.
I want to streamline that workflow as sketchup is great at 2d drawing too if complemented with layout for text, lifestyles dimensipning and pagination.
the issues that arise from working with layout, are also less evident when you work with 2d sketchup models/drawings.
-
@jql said:
The issue is a bit more complicated than that.
Architects using sketchup need an easy workflow to convert their 3d models into accurate drawings, to represent buildings and to share with consultants.
The workflow involves 3d modelling of the most important parts, 2d drawing that is extracted from 3d,and 2d drawings that complement those and are still accurate
usually the later are done in cad, but I do them in layout or sketchup.
I want to streamline that workflow as sketchup is great at 2d drawing too if complemented with layout for text, lifestyles dimensipning and pagination.
the issues that arise from working with layout, are also less evident when you work with 2d sketchup models/drawings.
I tried something: here is a scaffolding model
i made a component out of it,selected it, and applied these lines of code
model = Sketchup.active_model # Open model entities = model.entities # All entities in model selection = model.selection # Current selection for e in selection echelle = Geom;;Transformation.scaling [0,0,0],1,1,0.00001 e.transform!(echelle) end
and this is what i get
is it something like this you are asking for?
-
Apparently it is. I'm not in my pc though... Would that work with a section?
-
That scales the model on the Z axis to something close to 0 (actually 0.00001). So make sure to run in a few times to be sure that any vertical dimension gets smaller than Sketchup's tolerance.
-
If that scales to close to 0 it means it will have all the geometry between 0 and 0.00001 right?
It will still be 3D not 2D, it looks exactly like what I want it even get's textures.
But isn't that, exactly the same 3D model with the same amount of information? Won't it probably give Layout the same amount of work on 3D calculations?
Also as it isn't 2D it will be hard to export to CAD in a later stage when sharing with people that need dwg or dxf. Or it might give us errors when drawing in the 2D sketchup file.
Also, as Jiminy pointed out, it's working in Z axis only, though that would probably be easy to make it work in any axis (I'm personally interested in a section plane's normal direction.).
It's a shame though, as it is really looking exactly as the ideal 2D output would look.
Thanks for your input glro and Jiminy!
-
Well, if you run it a few times, the dimensions along the axis will get smaller than the tolerance, and Sketchup will merge everything.
I think... -
Then how will Sketchup know it has to keep the visible entities and disregard the rest?
-
i tried this
for e in selection echelle = Geom;;Transformation.scaling [0,0,0],1,1,0.0000 e.transform!(echelle) end
it works, 0 thickness, but colors are mixed
and it cannot be undone, i suppose, because 1/0 doesn't existall the geometry is in the flattened component, because the size of the file is about the same, before and after, and if i unscale by scaling the flattened component 1/00001, it works
model = Sketchup.active_model # Open model entities = model.entities # All entities in model selection = model.selection # Current selection for e in selection echelle = Geom;;Transformation.scaling [0,0,0],1,1,10000 e.transform!(echelle) end
It would be possible to scale along any axis
I tried to export the flattened model to dxf, and import it into my CAD software, designcad 9000, but it doesn't work
Then i tried to go back to sketchup from the dxf file exported from sketchup, and it worked, with one big difference: faces are not retrieved
here is the dxf file, if you want to try with another CAD software
-
@jiminy-billy-bob said:
Well, if you run it a few times, the dimensions along the axis will get smaller than the tolerance, and Sketchup will merge everything.
I think...yes, this would probably if objects within the global component would be alone (stray?)
but if the objects within the global component, are components themselves, nothing is merged -
@jql said:
Then how will Sketchup know it has to keep the visible entities and disregard the rest?
by scaling to 0.0001, the visible entities are kept visible
-
Scaling to 0.0001 will keep this as a 3D that looks flat so face "draw order" comes from the 3D itself... I can understand that.
It's pretty interesting that scaling it to 0 and then scaling it back up pops up the full model!
I could see that as a very interesting presentation tool by itself.
Imagine a flat plane with a google map in it, and then, suddenly a building and terrain start poping up from it... That would be very cool.
But what you're saying is that if you export to dwg/dxf and open it back in sketchup, sketchup convert's it into 2D data, though it looses faces? Then all the invisible faces become visible and if I'm exporting a roof view I will probably see all the floors beneath it... That wouldn't work though what you have still looks very good.
There is also an unmentioned issue that relates to camera, this only works in orthogonal projection mode, but I really can live with that as that is the kind of drawings I am after (2D orthogonal projections of the model.)
Though I understand the potential of the concept there are also other questions envolved like defining axis, sections and export to a skp model per scene:
- I can imagine that definnig axis by scene camera or by a section plane is probably something trivial for plugin developers;
- Having a section can be a bit more troublesome though as there will be many sections in the model. The way you describe your plugin to work right now, it would probably be a matter of copying the whole model and a given section into a component. Then use the section inside that component to do something like Zorro2 plugin and slice the component through the section. This new component, that would now be sliced, could be scaled flat;
- Then the matter of exporting this flat component to an external file, would probably be easy too.
So the problem I see is, still only one, the component isn't trully 2D but close to 0 thick:
- so it probably isn't fast to work with;
- it's probably innacurate to work with;
- and it probably creates a lot of issues when exporting to standard industry formats like dwg/dxf/dwf.
I'm thinking though, that if there was a way to make the component true 2D, it would be so lightweight and easy to use, that we could even not export it at all. It could be inserted in a new layer visible only in a new scene and both layer and scene could be named after the existing scene with a suffix/prefix related to the plugin:
- "Scene 1" - Original model view;
- "2D Scene 1" - Copy of Original model view, where only the 2D flat component is visible.
glro, I'm sorry if I'm sounding rude by saying all this so bluntly, but the fact is that I really appreciate all the input so far, and I do think the potential of this plugin is huge!
-
Have you tried using section cuts in SU......up to the limits of what you desire to show in LO/ 2D.
(think from the "back side" of the model)
IOW:
Think old western town movie prop. (facades only)I modeled a small developement a couple years back and to get a "street view" in 2D I used a section plane from behind to limit the info LO had to calculate. (I recall this working well)
Charlie
-
@jql said:
Scaling to 0.0001 will keep this as a 3D that looks flat so face "draw order" comes from the 3D itself... I can understand that.
It's pretty interesting that scaling it to 0 and then scaling it back up pops up the full model!
no, it has to be scaled at 0.0001, otherwise it doesn't pop up back
@jql said:
I could see that as a very interesting presentation tool by itself.
Imagine a flat plane with a google map in it, and then, suddenly a building and terrain start poping up from it... That would be very cool.
But what you're saying is that if you export to dwg/dxf and open it back in sketchup, sketchup convert's it into 2D data, though it looses faces? Then all the invisible faces become visible and if I'm exporting a roof view I will probably see all the floors beneath it... That wouldn't work though what you have still looks very good.
no
if it is scaled to 0.0001 exported to dxf imported to sketchup, faces are erased, but the model is still 3d, you can unscale itif it is scaled to 0.000, only then faces are erased and it is converted into 2D data
@jql said:
There is also an unmentioned issue that relates to camera, this only works in orthogonal projection mode, but I really can live with that as that is the kind of drawings I am after (2D orthogonal projections of the model.)
Though I understand the potential of the concept there are also other questions envolved like defining axis, sections and export to a skp model per scene:
- I can imagine that definnig axis by scene camera or by a section plane is probably something trivial for plugin developers;
- Having a section can be a bit more troublesome though as there will be many sections in the model. The way you describe your plugin to work right now, it would probably be a matter of copying the whole model and a given section into a component.
there is no plugin, only the few lines of code i pasted in the thread;i have not tried this code when a section plane is in the model.
@jql said:
Then use the section inside that component to do something like Zorro2 plugin and slice the component through the section. This new component, that would now be sliced, could be scaled flat;
- Then the matter of exporting this flat component to an external file, would probably be easy too.
So the problem I see is, still only one, the component isn't trully 2D but close to 0 thick:
- so it probably isn't fast to work with;
- it's probably innacurate to work with;
- and it probably creates a lot of issues when exporting to standard industry formats like dwg/dxf/dwf.
I'm thinking though, that if there was a way to make the component true 2D, it would be so lightweight and easy to use, that we could even not export it at all. It could be inserted in a new layer visible only in a new scene and both layer and scene could be named after the existing scene with a suffix/prefix related to the plugin:
- "Scene 1" - Original model view;
- "2D Scene 1" - Copy of Original model view, where only the 2D flat component is visible.
i don't see why being close to 0 would be a problem
the flattened component is as accurate as possible, in 2D
the size of the flattened component is not an burden for the graphic card, since it is flat, it is quicly shown; it can be for the RAM@jql said:
glro, I'm sorry if I'm sounding rude by saying all this so bluntly, but the fact is that I really appreciate all the input so far, and I do think the potential of this plugin is huge!
i have just followed your idea, because i was curious, and it has been fun so far; but i don't have much time to spend on it.
if you send a model with a few scenes set as you wish them to be flattened, with or without a section plane, i can make a try, copy each scene flattened to an individual sketchup file so you can check the result
-
@glro said:
i don't see why being close to 0 would be a problem
the flattened component is as accurate as possible, in 2D
the size of the flattened component is not an burden for the graphic card, since it is flat, it is quicly shown; it can be for the RAMThat's interesting. I didn't realize a flattened component would be faster on the GPU but I do understand why RAM could be an issue as many 2D flattened models/components would increase geometry drastically.
Being close to to 0 isn't 0. I intend on drawing uppon the flattened components and I've seen sketchup being picky with CAD imports wich such small deviations on geometry. Maybe that isn't an issue as my intention is overlaying other 2D drawings upon the flattened components.
However there's nothing like trying.
@unknownuser said:
there is no plugin, only the few lines of code i pasted in the thread;i have not tried this code when a section plane is in the model.
@unknownuser said:
i have just followed your idea, because i was curious, and it has been fun so far; but i don't have much time to spend on it.
if you send a model with a few scenes set as you wish them to be flattened, with or without a section plane, i can make a try, copy each scene flattened to an individual sketchup file so you can check the result
I understand there is no plugin so far, I was talking about the potential plugin or the concept for the plugin.
I will create a simple model wich represents one of my typical projects, but if you want I can also send you a PM with a link for a real project, not very big but with the usual complexity one of our architectural projects have. I can also send it's layout file.
-
@jql said:
there's nothing like trying.
OK for a typical model, each scenes should be prepared for flattening
the basic idea of a plugin could be ruined by memory overload or something else, so it is worth trying before going further -
Here is a simple model and layout example in V2013 (if you want another version please say so):
Flatten Faces Simple Model.skp
Flatten Faces Simple Layout.layout
Axonometric View has Shadows turned on but only in my best dreams would they be able to output to 2D.
I hope you keep having fun
-
If you make everything inside a component-instance then my CADup might do what you want ?
http://sketchucation.com/pluginstore?pln=CADup -
@jql said:
Here is a simple model and layout example in V2013 (if you want another version please say so):
[attachment=4:2jmovtqr]<!-- ia4 -->Flatten Faces Simple_1.png<!-- ia4 -->[/attachment:2jmovtqr]
[attachment=3:2jmovtqr]<!-- ia3 -->Flatten Faces Simple_2.png<!-- ia3 -->[/attachment:2jmovtqr]
[attachment=5:2jmovtqr]<!-- ia5 -->Flatten Faces Simple Model.skp<!-- ia5 -->[/attachment:2jmovtqr]
[attachment=6:2jmovtqr]<!-- ia6 -->Flatten Faces Simple Layout.layout<!-- ia6 -->[/attachment:2jmovtqr]
Axonometric View has Shadows turned on but only in my best dreams would they be able to output to 2D.
I hope you keep having fun
here is the result for some scenes
i am afraid it is not convincing
TIG's plugin surely will give better results
[attachment=2:2jmovtqr]<!-- ia2 -->AL Nasc.skp<!-- ia2 -->[/attachment:2jmovtqr][attachment=1:2jmovtqr]<!-- ia1 -->PLT Cob.skp<!-- ia1 -->[/attachment:2jmovtqr]
-
CADup is old, painfully slow and glitchy...
I have recent;y trapped it for errors better but...http://sketchucation.com/forums/posting.php?mode=reply%26amp;f=323%26amp;t=35096
Advertisement