Results 1 to 10 of 10

Thread: Looking for an OpenSCAD like 3D display component

  1. #1

    Looking for an OpenSCAD like 3D display component

    Hey fellas,

    I'm placing this here, just because, for 5m, I've stared at the categories and draw a blank. If anyone feels it belongs somewhere else, please say so.

    I'm doing a small application to design laser cut boxes. Yes there are already more than 3 online options, but the only one I really liked is a InkScape plugin that does dividers inside the box, so, not even an online option

    I'm looking for a component to display a 3D representation of the box, one you can manipulate to rotate the box.

    This kind of component is probably contained inside some of the various gaming engines/frameworks, I realise that, but I'm wondering if there's anyone that has stumbled on a single use version of the more generic ones contained in said engines/frameworks.

    Thanks in advance for any help, hint or obscure link.

    OpenSCAD: http://www.openscad.org/

  2. #2
    If you are looking for component/framework that will be able to render the STL file (commonly used in 3D printing) directly I don't think you will have much luck for that in gaming engines. Main reason for this is that STL file format only holds geometry information but no information about surface color, surface texture, or even surface material (useful in determining surface shading effects). And because graphics card actually needs that additional data commonly used formats by game engines already store it along with 3D model information for ease of use.

    But perhaps some of the 3D graphical engine developers might be willing to try and add support for importing a STL file format to their graphical engine in order to render it.

    Another solution might be to simply find a converter that is capable of converting STL format to some other 3D mesh format.

    And if you are more interested in designing of these 3D boxes then my best solution would be to use any 3D designing component/program and just find a suitable converter that can convert from any of the supported format from 3D designer to one of the supported format by your laser cutter.

  3. #3
    Quote Originally Posted by SilverWarior View Post
    If you are looking for component/framework that will be able to render the STL file (commonly used in 3D printing) directly I don't think you will have much luck for that in gaming engines.
    This is not my intention. I don't want it to read the STL and then generate a 3D object.

    I'm looking for a component that would take simple scene parameters, a 3D object (in whatever format) and accept a limited amount of inputs, mainly mouse grab to rotate and mouse wheel to zoom.

    I remember that some of the game engines/frameworks, I've tested through the years, contained a demo with just this. Some of them would also add a bit of rotation to said object.

    If there isn't something as simple as this in a component form factor, I can just take one of those demos and use what i need.

    My main issue is that I would like the 3D display to not need to control the entirety of a window and play nice with regular visual controls: specifically behave itself inside a TPanel.

    So, again, many thanks for any help.

  4. #4
    Quote Originally Posted by SilverWarior View Post
    And if you are more interested in designing of these 3D boxes then my best solution would be to use any 3D designing component/program and just find a suitable converter that can convert from any of the supported format from 3D designer to one of the supported format by your laser cutter.
    My main interest is not to dwell a lot over the 3 dimensionality of the box. Quite the opposite.

    My main focus is to produce an SVG that I can then import into InkScape and then export as an DXF (Yes, extra step maybe, but really don't want to implement the SVG to DXF if I can avoid it) of the FLAT representation of the sides in an ordered and neat manner to inject into the Laser Cutter software.

    The 3D representation is just a nice visual aid for the person doing the box, just like here: http://www.makercase.com/.

    So, like I said, visual aid and not main focus. Hence my search for a "quick fix" of sorts, so I can focus on the SVG creation with a line representation of the 5 to 6 sides of the box, laid flat to then cut on the laser.

    Again, many, MANY thanks for any help.

  5. #5
    Quote Originally Posted by gcarreno View Post
    I'm looking for a component that would take simple scene parameters, a 3D object (in whatever format) and accept a limited amount of inputs, mainly mouse grab to rotate and mouse wheel to zoom.

    I remember that some of the game engines/frameworks, I've tested through the years, contained a demo with just this. Some of them would also add a bit of rotation to said object.
    So basically you are looking for 3D model/scene viewer then.
    Well most 3D graphical engines does support rendering to specific window (so you can render onto your panel for instance) but such rendering is not common as it might affect engine performance. But since you intend to only show single 3D model or more simpler scenes the performance drop won't be an issue. And making a 3D graphical engine into 3D model viewer isn't even so difficult as you only need to initialize the graphical engine, load the 3D model, and then apply proper rendering technique for the 3D model to be rendered nicely.
    The only problem might be support for specific 3D model format as they are so many of them out there that you would probably have problem finding one graphical engine that could load all of them out of the box. So without us knowing in which format are your 3D scenes or models saved we can't provide you with any more specific suggestion of which graphical engine to use.

  6. #6
    Quote Originally Posted by gcarreno View Post
    The 3D representation is just a nice visual aid for the person doing the box, just like here: http://www.makercase.com/.
    Wait only now did I realize that you need this only for boxes and not more complex 3D objects.
    This actually makes things a lot easier because such box can be composed either from 6 individual images (each image for each box face) or one image representing extruded box which can then simply be projected onto the box for rendering.

    So if I understood you correctly you are making a software tor designing these 3D boxes right?

  7. #7
    Quote Originally Posted by SilverWarior View Post
    So basically you are looking for 3D model/scene viewer then.
    I guess one can call it that. I keep trying to make a point based on OpenSCAD. Why? Simple: My objective is to do the same exact thing but WAY less generic.

    Quote Originally Posted by SilverWarior View Post
    But since you intend to only show single 3D model or more simpler scenes the performance drop won't be an issue. And making a 3D graphical engine into 3D model viewer isn't even so difficult as you only need to initialize the graphical engine, load the 3D model, and then apply proper rendering technique for the 3D model to be rendered nicely.
    This is pretty much what I had in mind.

    Quote Originally Posted by SilverWarior View Post
    The only problem might be support for specific 3D model format as they are so many of them out there that you would probably have problem finding one graphical engine that could load all of them out of the box. So without us knowing in which format are your 3D scenes or models saved we can't provide you with any more specific suggestion of which graphical engine to use.
    To answer this I can only say: I would have to stick to the default 3D Model format that specific engine/framework uses.

    My scene is so simple that I would pretty much hardcode it into the bin any way. The only thing that actually changes is the box.

    I actually have 2 specific ways of displaying the box:

    1. Flat representation of the box that will be outputted to the SVG.
    This is useful, since I'm planning on having more than one arrangement of the sides.
    This will not need a 3D Model viewer. A simple DrawBox will do.
    2. 3D representation of the box, mainly because it's purty
    This is where I'm pretty much stuck.

    And that's all she wrote, actually.
    Last edited by gcarreno; 06-10-2016 at 10:56 AM.

  8. #8
    Quote Originally Posted by SilverWarior View Post
    Wait only now did I realize that you need this only for boxes and not more complex 3D objects.
    This actually makes things a lot easier because such box can be composed either from 6 individual images (each image for each box face) or one image representing extruded box which can then simply be projected onto the box for rendering.
    I think you almost got it. The "almost" is due to the fact that the box can have less than 6 sides.

    Let's say you want to make a lid-less box. This would have only 5 sides.

    Let's also say that this lid-less box has internal separators, one vertical, one horizontal. Now you have a lid-less box that has 4 compartments in it.

    Let's also say that those separators are lower than the top of the box, because you want to have a slide in lid.

    Hope this makes it clearer.

    So in terms of the 3D model, I'm thinking I can have the 2D contour of each side with the ply thickness extruded.
    Translate said sides/separators into a box and then spit out a 3D model.
    The "skin" is pretty much a single colour. Don't know if a map on it or just a material.
    Well, these are the basic premises you use in OpenSCAD. Don't really know if this can work in a "generic" 3D Model Viewer context.

    Quote Originally Posted by SilverWarior View Post
    So if I understood you correctly you are making a software [to design] these 3D boxes right?
    Pretty much.

    You start by setting the units: mm/inch.
    Thickness of the laser safe plywood: most common is 3mm or 6mm.
    Then you set if measurements are inside or outside.
    You then input Width, Height, Length of the box.
    Decide on what type/size the "notches" will be.
    This will give you a TreeView of your Box as root and the Sides as children.
    You can add separators, and these will show on the TreeView as well.
    You can then select each of those nodes on the TreeView and manipulate further.

    Once you're happy with your design, you export to SVG. What this software exports is a bi-dimensional vector image of the sides and/or separators.
    If you're happy with the layout exported it's just a 4 step thing: Import into InkScape; Export to DXF; Import into Laser Software; Cut.

    Since I'm not really into doing a DXF exporter, you need use InkScape to export your DXF.
    Most, if not all, laser cutter software works with a DXF importer.
    Unfortunately the commercial laser cutters come with proprietary software and each one has it's own obscure/proprietary internal format.

    My HackSpace goes through many of such box designs, and it's a PITA to then have to mess around inside InkScape (Not really a box design tool) to customise the generic 6 side box that most of the online helpers produce.

    That's my main drive, anyway

  9. #9
    PGD Staff / News Reporter phibermon's Avatar
    Join Date
    Sep 2009
    Location
    England
    Posts
    524
    Engines/Frameworks - model viewers - these are all more or less pointless for what you want to do. Your entire object is dynamic - potential open sides, compartments - adjustable heights.

    It's a 3D representation of real-time parameters - not a viewer for 'static' data which is what 3D rendering engines focus on.

    You're working to a level where there's not really any abstractions that would save you time.

    Yes sure - you can use an engine to give you an 3D accelerated view - manage your window, input etc or an engine to render things in software should that be your desire.

    But what you're doing is so simple you'd not really be slowed down much by using a basic OpenGL template.

    (My engine has DXF import/export and STL import capabilites - but it's not yet released.)

    But to save you some time and give you the toolkit you crave - what you want to use is :

    GLScene.

    Yeah it means GL support is required (but you're drawing such simple geometry that even the built in software GL rendering of windows or MESA under posix systems will be fine - so it's not restricting your app to requiring actual 3D hardware) it's all wrapped up nicely with Lazarus/Delphi - it was pretty much designed for this exact kind of abstract design in mind and the integration with Lazarus/Delphi lets you use already existing widgets/components/apps like you're no doubt already familiar with.

    As far as rendering the data is concerned - construct it dynamically from scratch - perhaps use a unit cube you can quickly transform to create compartment walls and so forth.

    But you're going to have interlocking parts in the compartments? slits from where sliding panels extrude?

    You want to take your paremeters, construct the vector data directly in a flat array, upload it into a VBO - bish bash bosh. render - done.

    Perhaps you want to be able to click on the model, drag bits around and all that jazz - GLscene has all the maths functions and helper functions to easily handle picking/ray-casting if you so desire.

    Get GLScene, get it setup with Lazarus/Delphi - whatever you use, have a look at some examples or just take one of the examples, put a scene viewer on a form.

    Start from there.

    Width/Height/Length - editboxes or whatever your app design is - then from those numbers, construct the 6 points of the cube in an array, then construct the 12 triangles, two for each face, upload the data to a VBO render in the sceneview. (you can also use the GLU Tesselator if you want to ignore thinking about triangles, just make 6 faces and pump the data into the tesselator - GLScene probably has a wrapper already for it - but it's trivial stuff and the documentation is online)

    Add each feature incrementally cause your design is custom and there's no road-map for where you're going.

    Let us know how you get on, we'll always try to help

    Oh and use GLScene from SVN/GIT whatever versioning system they're using - the stuff on the site will probably be very out of date - they suck at updating their site so much it's not even funny - but GLScene itself is maintained.
    Last edited by phibermon; 08-10-2016 at 08:16 AM.
    When the moon hits your eye like a big pizza pie - that's an extinction level impact event.

  10. #10
    Quote Originally Posted by phibermon View Post
    (My engine has DXF import/export and STL import capabilites - but it's not yet released.)
    I really hope I can use these thing in the future. How's it progressing anyway?


    Quote Originally Posted by phibermon View Post
    But to save you some time and give you the toolkit you crave - what you want to use is :

    GLScene.
    Ok, this looks like a good suggestion, I'll have a good rummage through.


    Quote Originally Posted by phibermon View Post
    Add each feature incrementally cause your design is custom and there's no road-map for where you're going.

    Let us know how you get on, we'll always try to help
    That's how I usually work, one step at a time.

    And YES, will definitely report back!

    Quote Originally Posted by phibermon View Post
    Oh and use GLScene from SVN/GIT whatever versioning system they're using - the stuff on the site will probably be very out of date - they suck at updating their site so much it's not even funny - but GLScene itself is maintained.
    Thanks for this tip, this is great stuff and it gives me something tangible to begin working on.

    Thank you very much @phibernon!!

    Cheers,
    Gus

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •