What's new

Bumpmapped surface creator

sigseven

Senior Member
This tool will allow you to select a grayscale bitmap, and have a part generated in alibre that uses that image as the basis for a surface. Like so:

This image


Makes this part


Or rather, it makes all the sketches which you then select and make a loft of since loft function isn't quite there yet in the API. I don't know if it's really that practical, but it's a fun tool to play with anyway. If you wanted to incorporate it into an existing part you have, you could probably do so with cuts to get the shape right if a square is less than desirable and then boolean operations.

Download:

A few more caveats to be aware of:
-Don't do anything in Alibre until it finishes.
-It's definitely not fast at all, and big images will most likely take forever or not finish at all.
-I would try something just 32x32 at the biggest to start out.
-You must have .NET 2.0 installed.
-If the resulting loft looks kind of funky you might want to try turning up the curve faceting.

If you need something to easily resize images and save them as bitmaps, IrfanView is very good for this purpose and is free.

That all said, this is just a very rough first version. I will be added a number of other options such as:
-Setting the scale for height, width, and depth
-Adjustable 'base' height
-Built in options for downsampling the image so that a less ridiculously complex surface is created
-Maybe options to adjust the order of B-spline used I guess?
 

Attachments

  • Bumpmap Import 1.0.1.1.zip
    88.5 KB · Views: 303
  • brick-map.jpg
    brick-map.jpg
    1.5 KB · Views: 1,808
  • brick.jpg
    brick.jpg
    41.9 KB · Views: 200

Mibe

Alibre Super User


Cool! :)

I created a similar tool for SolidWorks back in 98. It also had support for surface functions (X=Y*COS(Z) and similar, like Mathcad but simpler of course). That should be quite easy to include in this one - am I right?

I wish I had time (and patience) to learn the Alibre API :cry:
 

sigseven

Senior Member


Updated! I added the controls for adjusting the height of the base, the order of the b-spline, the x/y-type scale, and also the 'bumpiness' factor.

I think I understand what you are asking for by surface functions. I'm sure it would be possible, the actual API related parts wouldn't change at all, it would just be a different way of populating the matrix used to store the heights I guess. Math isn't really my strong point so I guess I'm a bit reluctant to get started on implementing that though. D:
 

Mibe

Alibre Super User


I tested it and it took a loooong time... Alibre created about 250 planes/sketches in over 60 minutes, before I CTRL-ALT-DELETE. Not sure where in the process it was, perhaps better control of number of sketches? And some progress bar? :)
 

sigseven

Senior Member


Yeah, currently it's just doing one plane per row and one control point per column. That's why I said you shouldn't try anything larger than 32x32 pixels at first so you can get an idea of how long things will be on your machine. There's really no way around big images taking forever considering how complex of a surface it makes.

I'm debating whether I should bother adding a downsampling option at all, since even the most basic image programs have better resampling algorithms than anything I would write for this. Again, if you need something to resize or crop your image to make it something that won't take hours, I would suggest IrfanView.

Also, it was updated again to fix a bug introduced by allowing the height of the base to be changed. D:

edit: I'll see about making some sample images for people to try it with. In the mean time, the one used for the brick pattern in the original post should work fine if you convert it to a bitmap.
 
Top