Jump to content

Coding approach to modelling custom/configurable pipe furniture


Recommended Posts

Hi all, 1st time poster, only recently even aware of BabylonJS and extremely impressed!

I have a problem that after hunting around, I am still a bit unclear on how to best proceed. I'm an experienced coder, C#, PHP, JS, etc etc, with some game engine programming experience many many years ago, so I am aware of concepts etc, but new to the BJS tech and best approaches to a modelling idea I have.

I want to model metal pipe furniture in Babylon... think chairs, bed frames, nightlamps, whatever you can imagine, made out of standard household fittings. Think something like this: 5a794ea7ae4cf63ce576cec48ffc7a3c.jpg or http://inspiringhomeideas.net/wp-content/uploads/2015/12/Stunning-copper-pipe-furniture-design-plus-lead-pipe-furniture.jpg

The kicker is that I would like to be able to dynamically MODIFY the designs... say, increase the width, add an optional attachment, customise the design. Ideally, i'd come up with a furniture design, set parameters on which parts of mandatory, which attachments are optional, which segments can be scaled, apply all such modifications to the 3D rendering, and on approval, save the result for build and sale (if I make it that far). Note that this isnt simply scaling the entire model, instead I need specifically to allow certain parts to grow/shrink in length say, (according to availability of the pipe components), while not warping in any other way.

In the B/JS world, would you approach this with pure meshes? With Bones, to define connector points between joints? I've looked at various house/room designer tools but they tend to deal with furniture LAYOUT, not the design/creation of the furniture itself. And not that i dont want to allow people to design a product from the ground up, merely to apply mods to preexisting designs.

If anyone has approached a similar problem, or has ideas on where to start my investigations, I would love your input!


Link to comment
Share on other sites

Hello and welcome!

My first thought will be to use stock mesh creation tools (see MeshBuilder here). You can then create pipe and play with the wonderful ribbon tool or try the parametric shapes.

These tools allow you to really control your design so you can then scale things up or down and update the global furniture (composed of a mix of these shapes)

Link to comment
Share on other sites

Hi mate, thanks! It looks like I am best served by going through the tutorials and just diving in, maybe purchase the books that I keep seeing if required as well. In terms of distorting the models, I see the V8 demo and it looks pretty amazing, in terms of rigid surfaces, moving hinges etc, so if i can get hold of that source code it might point me in the right direction modelling-wise, and then i have to come up with some sort of toolkit/engine structure to perform the modifications etc.. shopping-cart-style :) The meshbuilder and ribbon etc looks like a fantatstic start, i am really impressed and already thinking about how they might work really nicely. 

I notice you didnt mention bones/skeletons, is that because you think they wont be needed, or just didnt mention them and think the mesh approach will be sufficient? I only ask about bones because I can imagine defining pipe connections as connections in a bone structure, and potentially having rotatiosn of joints etc modelled that way?

I noticed one of the other users had built a kind of furniture modelling tool, I might quiz him as well, slightly different idea but he might have some good input. Thanks again! Hopefully I'll become a regular :)

Link to comment
Share on other sites

Hi DH, welcome aboard.  Yeah, your project sounds excellent... and I think you're in just the right dev environment.

There are issues... some big ones.  Let's look at common steel water pipe... and let's talk about furniture/shelving frames.

There are some "rules" in the water pipe world.  It comes in limited sizes, so you need to place those same limits on a "dynamic water pipe assembler" function.  When user wants to assemble/scale a water pipe frame... the user will need to follow the rules of water pipe.

Now, let's talk about hybrid frames... frames made of a mix of copper water pipe (not threadable)... and standard 1.5 inch steel.  There are some adapters needed, points of connection between one material and another.  There are "rules" to that, too.  Methods of attachment.... some methods rated for 60 LBS, some for 200 LBS.  Rules, rules, rules.

Now, let's bring-in the threaded rods.  We must not allow the user to build a contraption (and then order it)... that will collapse or tip-over and kill the poodle FooFoo.  :)  Rules.  Scaling rules.  No threaded rods longer than .75 meter.  Too much wobble in that material.  Same with wooden dowels... wobble... and not rated for high loads.  Rules.  The "let's make furniture out of commonly found materials machine"... will need to be quite a "smart" algorithm... for these multi-material structures.

This thought... might make you think about making 2-5 machines... a different assembler class/factory for each type of common material.  Naturally, 1.5 inch steel water pipe is very common... and extremely sturdy when threaded together into sub-structures.  It is also very heavy, hard to ship, even harder to assemble, and even even even harder to make it be "pretty".  :)  That's why shelving makers use crap plastic, and a PVC shelving unit is quite a structurally-sound treat.  heh.

Anyway, I'm just rattling.  Tubes/cylinders are easy to dynamically generate with BJS/WebGL.  But the connectors... might be another story.  If you need high-detail and complicated widgets at the connectors, you will probably have to make or steal some medium-rez models... and import them into the BJS scene.  It is a good bet that common pipe connectors and couplers HAVE been modeled, somewhere, by somebody.  Joint models.  Got a big collection gathered-up?

But if you DON'T need to allow the user to zoom-in on the connectors... then... you will STILL need basic modeled mesh of the connector (such as a 3-way corner of a box)... because... I don't think Babylon's Tube thing... can easily create a 3-receiver tube connector.  I could be wrong.

Oh yeah, remember "the hybrids"... the furniture that mixed threaded steel waterpipe with 3/4 copper, with wooden dowels, with a mahogany countertop?  How many kinds of connectors/attachers will we need there?  I wonder how many sizes those couplers "come-in", so when we go to scale-up the furniture... it can follow "the rules".  (As in... the bracket that holds the copper pipe to the countertop... isn't available in 3 inch, so the user is not allowed to scale this table/desk any larger.  Darned rules!

I think game programmers call that "game logic".  What is allowed and what isn't.  Or, I could be talkin' crap.  I'm well-known for that.  :)  Welcome again, DH.  You look a little unhappy in that picture.  Can I get you a beer or something?  ;)  Party on.

Link to comment
Share on other sites

G'day Wingnut.. thanks for the feedback! You are absolutely correct, this is a potentially massive headache, and I've been thinking about it for a while, but I think there are a few key things that I can do to make my life easier. 

I'm not really planning to build a "design furniture from the ground up" tool... that would be a total pain in the bollocks, and exponentially difficult to code, design, deliver, administer, make safe, etc. Instead, similar to what you suggested, I am planning to design my own items, start off with a few designs that I have built myself for my own use, and use those designs to make somewhat "locked down, preapproved" modifications.. think say, swapping out the muffler on your motorcycle using pre-approved, "we-know-in-advance-that-this-fits substitutes", for a fee, rather than "here's a pile of metal and a lathe, why don't you mill and weld a design of your own?"

So, still a complex problem, but one markedly simpler than a free-design tool.

Absolute realism isnt critically important, but i WILL need to do some work with textures etc, so that the Babylon model doesnt look brutally ugly. For the pipe furniture itself though, "pretty" isn't something I'm generally going for ;) A more, industrial design ethos, perhaps?

Looking at the V8 and Robot demos, they encompass a few of the ideas I like.. a rigid structure (metal cylinder, rather than cloth), joins and axes of rotation.. if i can get a hold of their source code, I am pretty sure I can start coming up with something of interest. Then there'\s the question of tying THAT into a shopping system... I'm gonna be a busy boy!

As for the face, not much I can do I'm afraid, its the one my mother gave me! Coincidentally, I just realised, the background is my mate's garage where we were renovating his house a couple years ago, so maybe that's a good sign...


Link to comment
Share on other sites

1 hour ago, dale.holborow said:

As for the face, not much I can do I'm afraid, its the one my mother gave me

hahah.  Yeah, I understand.  It is a fine face, it is.  But, is there a picture around... where we could see you laughing or smiling?  I'd browse it.  :)  Got website?

Link to comment
Share on other sites

1 hour ago, Convergence said:

My attempt (loosely based on your pictures)...

Wow.. I didn't expect that. More than the technical side (Typescript over pure JS, tech demos etc), this has just just convinced me that a) the library is quick and easy enough to use, and b ) the community is active, proactive and friendly! Thanks very much, I'm really looking forward to diving into this!

Link to comment
Share on other sites

15 hours ago, Wingnut said:

hahah.  Yeah, I understand.  It is a fine face, it is.  But, is there a picture around... where we could see you laughing or smiling?  I'd browse it.  :)  Got website?

You... you want me to pose and post photos? But mate, I can't.. I have a rule, if you're good at something, never do it for free ;) 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Create New...