I'm just taming my computer, not you
P: Magy
I've not yet had this download problem in this forum. I remember that I've had it in the old @Last/Google forum a couple of times. Never with .skp or image files, but several times with .rb files. What made it even stranger was that I was able to dl .rb files from most members but not from some and that the problem was very consistent.
My workaround at that time was switching from Firefox to MSIE for just those downloads.
Download managers can indeed interfere with dl filenames, in FDM is a checkbox "automatically create filename". With that turned off losts of dl's end up as .php, .htm, .aps and so on. Often useless files for which renaming is not a solution.
P: Maggy
Thanks Todd, I'll look into it in case I'm going to need it (likely) but Didier already solved it for this script.
[Maggy]
Thanks a lot!
It's all over the docs that SU internally only uses inches. But no simple explanation on how to change an imperial script to metrics. A bit strange (read: yes, idiot indeed).
I guessed, after looking into existing scripts, that .m somewhere should do the trick.
I probably tried
e.pushpull Float( dist[0])".m"
e.pushpull Float( dist[0].m)
e.pushpull Float( dist[0.m])
e.pushpull Float( dist.m[0])
plus several other places in the script.
And I already found out that in this case e.pushpull 630 gave an acceptable result after all. The first time I tried that I must have accidentally pushpulled a much smaller face than I thought.
[Maggy]
I'm trying to use extrude_faces_along_normal.rb. My model is in meters. But when I try to extrude faces 16 meters, it does extrude exactly 16 inches. When I type in 16m instead of 16, nothing happens. I tried again after using a calculator to convert 16 meters to inches, typed in 630 but then the extrusion was much too long, didn't measure. (630 feet? 630 yards?)
Then I looked into this script, it looks extremely simple but I can't find where it decides wether to use inches, feet, yards, meters or whatever. I dived into "Programming Ruby", couldn't find the answer, searched the ruby forum... I'm lost.
BTW I do not know who wkai is, the writer of this ruby, but once I get it to work, it'll save me te manual extrusion of 19000 faces! Just in one project. I believe we, ruby downloaders, can't ever thank ruby writers enough for all the time they save us.
[Maggy]
I love it. But will it be possible to move these dimensions to wherever you'd like to see them? In the flash movie most dimensions stick to the surface, I'd like to move them a little away from the model, like the first two dimensions.
[Maggy]
Jim, those ideas are sticking like superglue! The industrial type.
[Maggy]
SelectionMemory is a good start, but for me it should be as intuitive as most of SU is.
Maybe that tells you more about me than about the ruby...
[Maggy]
Your link to the Paintshop pluging contained no explanation whatsoever of the word bump map. That is why I placed another url, to a Gimp plugin that does explain that term.
But the Paintshop plugin is a smart bumpmapper and not a real SFS.
@unknownuser said:
Animation of space ship going through a tunnel (seen at right) lined with rocks. Bump maps of the rock material were created by the Shape from Shading plug-in.
@unknownuser said:
Image can be rendered as a bump map in your 3d application
First quote can be read under Tunnel.avi, second is the end of the plug-in demo SFS.avi.
edit: added model to demonstrate difference between BM and SFS. This guy is nice and grey. I have neither BM nor SFS software installed. But I believe BM will probably push this man into the background while SFS at least theoretically should be able to see that he is floating in mid air. We can see that at first glance. It was the intention of mister (professor? doctor?) Horn, on of the founding fathers of SFS to give computer vision that very same level of intelligence.
The S from Shape stands for 3D, bump maps can give a very nice 3D impression, but are actually no more 3D than stereoscopy.
They call it SFS but it's actually bumpmapping.
See http://docs.gimp.org/en/plug-in-bump-map.html
As you can see, the middle part of the example picture strip is the actual bump map, white is high, black is low. Just like what Didiers ruby expects.
Both SFS and bumpmapping are science at its peek. Bumpmaps from actual 3d information are a very reliable way of representing this 3d info textured in a 2.5D way in very small file format. Going from a single 2D picture to 3D can not be reliably done with bumpmapping, while SFS can, but not with any image.
There are high end video camera's with very advanced bumpmapping capabilities, but they use time of flight (TOF) technology to create the bumpmap. TOF means it uses the time that light needs to reach the sensor to calculate the distance. You can see the result of such cameras being used very creatively for example in movies and commercials where they're able to freeze frame while you see smoke and flowing water "freeze" in mid air, then zoom, pan, orbit the view. What you do not see is that the camera actually doesn't move or zoom.
Another effect is titles floating in mid air between a show host and the background in a live broadcast.
[Maggy]
Didier, I did not complain, I did not call it useless and indeed I did not read any docs. I did try to find docs on the above mentioned link. I do know that lots of height maps are either in gray scale or showing heights as colors that can easily be converted to grayscale. For such height maps a script like yours is VERY useful, as long as the dummie first time user can find the docs. I found out today that I should have clicked the asterix. That's what the Dutch call "looking no further than a nose length".
Maybe it would be a good idea to use more standard icons, like the Acrobat icon, to show dummies that we should download a document.
OTOH even after reading the beautiful pdf, I still don't know what went wrong with my first test of heightfield_gen.rb. I used the face of my first message in this thread, scaled down a lot and saved as PPM in Paintshop Pro. The ruby gave no error message. I did allow it to finish for about 30 minutes.
I'm currently on another computer, I'll give it another honest try when I'm back home.
But you have to admit that my avatar would look prettier in well performed SFS than what you've done to my face.
[Maggy]
Although there've been publications about SFS in the eighties, the practical use is still rare.
[Maggy]
It depends on what you call a "standard photographic image"? If you:
-cover your subject and background in flour
-use only one and exclude all other light sources
-record camera distance, angle, lens type, aperture
-record light source distance and angle
SFS will work perfectly
If you want to use a picture like this one, how could the software possibly see the difference between shading, dress pattern, dogs and so on?
For example radar images or monochromatic laser scans are ideal for SFS.
[Maggy]
No, shape from shadow (SFS)is much more intelligent than that ruby.
Look at this face. The tip of the nose is just as white as the cheeks. Both sides of the nose are dark, shaded. With a white is higher, darker is lower algoritm this would not look like a face at all. An SFS algoritm does actually recover the face shape. In this case the light source is near the camera. In ordinary lighting conditions the nose would probably have one lighter side and a large shadow over the the other cheek. Heightfield can't understand that, SFS can.
BTW is Didier is listening: I tried the ruby and it seems to be as dead as a doornail. It does show a ppm file open dialog, I did translate this face into PPM for the occasion, then it asks for some numbers, I use the defaults, SU stays empty.
I've not yet tried the SFS software from this link, I do own a 3D camera that works in a similar way.
[Maggy]
First of all, one piece of good news is that I found out that not Dassault, but actually Lattice developed 3DXML, an extention of their own Lattice XML. On websites about Lattice XML I also find the extension XVL bud have not yet found out what that is.
One site that looked interesting to me at first sight is http://www.sns.gov/APGroup/appProg/xal/xalDoc/gov/sns/xal/model/xml/LatticeXmlTest.html but perhaps it has nothing to do with this subject. After all it won't do us much good that there are zillions of sites about ordinary XML either.
And the best news so far is that I received a quick and dirty triangle only to .obj converter in Python script. So if any of you can read Python (my fav. scripting language, use it a lot in Paintshop) and change it into ruby, that would probably be all we need.
-Jim Foltz created an .obj importer for SU, is on scriptspot
-I guess most geometry that we would ever like to capture will probably be triangulated
-I believe all textures in 3DXML are stored either in their native format or as BMP. Finding binary blocks of data, copying, saving should be easy with any hex editor.
[Maggy]
I tried 2 ways to upoad a publicly downloadable 3DXML, but for some reason I'm neither capable to upload it to my blog nor to my homepage. Any other suggestions?
You could also download 3dprintscreenhttp://www.3ds.com/products-solutions/3d-for-all/3d-xml/1/
, capture any model from sketchup, google earth 3d buildings or whatever. You can view the model in the viewer that can be downloaded from the same page.
The result of the 3d printscreen is an ordinary zip file, when you unzip it, it contains one file called manifest.xml and one file with the same name as the printscreen (so don't try to unzip to the same folder).
Here is a small sample of the unzipped 3dxml:
</Instance3D>
<ReferenceRep xsi:type="ReferenceRepType" id="4" name="RefRep_4" format="TESSELLATED" associatedFile="urn:3DXML:Representation:loc:6"/>
<InstanceRep xsi:type="InstanceRepType" id="5" name="InstRep_5">
<IsAggregatedBy>2</IsAggregatedBy>
<IsInstanceOf>urn:3DXML:Reference:loc:4</IsInstanceOf>
</InstanceRep>
<Reference3D xsi:type="Reference3DType" id="7" name="Ref3D_7" />
<Instance3D xsi:type="Instance3DType" id="8" name="Inst3D_8">
<IsAggregatedBy>1</IsAggregatedBy>
<IsInstanceOf>urn:3DXML:Reference:loc:7</IsInstanceOf>
<RelativeMatrix>1.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 </RelativeMatrix>
</Instance3D>
<ReferenceRep xsi:type="ReferenceRepType" id="9" name="RefRep_9" format="TESSELLATED" associatedFile="urn:3DXML:Representation:loc:11"/>
<InstanceRep xsi:type="InstanceRepType" id="10" name="InstRep_10">
<IsAggregatedBy>7</IsAggregatedBy>
<IsInstanceOf>urn:3DXML:Reference:loc:9</IsInstanceOf>
</InstanceRep>
[Maggy]
In short: 3DXML is an open source file format closely related to XML, so closely related that you can even drop a 3D object into a Word document and the recipient can zoom, pan, rotate.
Dassault calls it 3D for all. They give away a free viewer (works great) and a free 3D printscreen program that captures 3D objects, geometry and texture from almost any opengl or directx program.
That's exactly how far Dassaults efforts have gone so far in realising the ideal of "3d for all". Most of their software is not only expensive, it's even hard to find out how expensive. No trial versions, no price list, no online ordering. They reply to English questions in the English webform on their English website... in French.
So that 3d for all can only come true if most popular 3d software would get an importer/exporter/converter for 3dxml. If this file format is as good as Dassault believes (and they build a.o. airplanes) it could mean a great step forward.
[Maggy]
You can find everything about 3D XML on
http://www.3ds.com/products-solutions/3d-for-all/
[Maggy]
would it be hard to create a multiple copy option?
One tree times 10 times 10 would create a very nice forest, shift some individual trees for a nice natural random effect.
I know that there are already several ways in SU or with existing rubies to do this, but it would make this tool even more flexible.
[Maggy]
actually I guessed it was something like this model, a dowel with a square head or something similar
poster-Maggy