Go Back   AC3D Forums > Resources > AC3D Tutorials and How-To's
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

Thread Tools Display Modes
Old 7th November 2012, 05:34 AM   #1
Senior Member
Professional user
Join Date: Jun 2006
Posts: 102
Smile Booleans: think BIG!

Yesterday night I was drawing a 3D phillips screwdriver, so just for the fun of it - only in this forum I could admit such a weakness without looking too much of a moron.
Well, the quickest, cleanest way to do the job was to byte four right-angle chunks off a basic cylindroconical shape - that's to say, boolean subtract.

My past experiences with AC3D's booleans weren't really amazing, so I tried without much enthusiasm. And punctually the outcome was a disaster: plenty of missing surfaces, the sinister cyan glow of illegitimate ones, the weird red contour of distorted ones... not very encouraging indeed.
Then a tiny light bulb popped alight somewhere in my skull: my model was tiny, the 0.0125 units/inch suited for an actual-size DAZ prop. Now what if... no sooner thought than done, I clicked 8 times the 200% button and tried again.

This time the outcome was impeccable.

Curious, I began challenging the booleans with increasingly difficult provocations - all of them 256 times as large as usual - and each time the results were flawless.

As a physicist I don't believe in miracles (other than when my mother-in-law occasionally shuts up, but that's another story), so I started looking for an explanation in order not to have my sleep haunted by ghost booleans. And a plausible reason eventually surfaced:
the floating point arithmetic has its limits: we just cannot squeeze infinite real numbers into the finite range a computer can handle, no matter how we represent them. Or, to be more precise, we can do that, but not without losing some small change en route.
Now, if you're wealthy enough you can afford that much without even noticing the loss, but if you're a beggar small change may be all you have in your pocket. And my original tiny model was definitely a beggar.

I'll stick to this hypothesis until someone comes up with a better one. And in the meantime, every time I'll have to use a boolean, I'll enlarge my model some 256 times first, boole it, and then shrink it back to the original size. Apparently it works fine.

And should someone better skilled than I find a discrete procedure to do the same without so much fuss, I'll be happy to buy her a bottle of champagne (if she's a she) or him one of whisky (if he's a he) .

Last edited by coldby; 7th November 2012 at 07:10 AM.
coldby is offline   Reply With Quote
Old 7th November 2012, 09:03 AM   #2
Senior Member
Professional user
Mossie's Avatar
Join Date: Dec 2003
Location: UK
Posts: 369
Default Re: Booleans: think BIG!

A very interesting discovery.

I built a complex structure and a set of three oval tubes to use for cutting.

At 0.1 m scale it left a large number of anomalies
At 256% scale, it left a smaller number of anomalies
Increasing scale another 256% resulted in no anomalies.

So what happened if I scaled it to 1%, AC3D crashed.

You may well be on to something. A flaw or overflow of the maths.

Would be interesting to hear what Andy has to say about this.

Booleans have always been a bit hit and miss.
Regards, Gerry "Mossie" Mos
WW1 Aircraft Library

Mossie 3D CAD, "Prompt and Precise"
Mossie is offline   Reply With Quote
Old 7th November 2012, 10:27 AM   #3
Senior Member
Professional user
Join Date: Jun 2003
Location: Greensboro NC, USA
Posts: 337
Default Re: Booleans: think BIG!

I haven't used a 3D program that booleans were not messy. Andy did suggest scaling up your model for booleans (but he didn't mention any pertentages) in a post a few years back. So, yes it does work, and Andy is aware of it. I would still like more of an explanation. Andy??????????
foxa is offline   Reply With Quote
Old 7th November 2012, 11:47 AM   #4
Professional user
Andy's Avatar
Join Date: Jun 2003
Posts: 4,563
Default Re: Booleans: think BIG!

Coldby got it spot on - it's down to the number precision. AC3D is used over such a wide range i.e. some people are creating entire lifesize oil-rigs, some people creating models that are fractions of a mm in size. The boolean functions works best in the middle somewhere
Andy is offline   Reply With Quote
Old 7th November 2012, 11:49 AM   #5
Senior Member
Professional user
Join Date: Jun 2003
Location: Greensboro NC, USA
Posts: 337
Default Re: Booleans: think BIG!

Well, there you go then. Ask and ye shall receive.

Thanks Andy
foxa is offline   Reply With Quote
Old 11th November 2012, 10:08 PM   #6
Advanced member
Join Date: Jul 2010
Posts: 43
Default Re: Booleans: think BIG!

Interesting discovery, thanks!
Tonka is offline   Reply With Quote
Old 8th October 2013, 06:01 AM   #7
Junior Member
Geoffm's Avatar
Join Date: Aug 2013
Location: London UK
Posts: 22
Lightbulb Re: Booleans: think BIG!

Resolution is also a problem for large models that are a long way from the origin (eg a metre sized object constructed 10 km away from origin). The resolution is spending most of its bits in defining the kilometres and less on the resolution of the model. Here move the object to (000) and perform actions, then if really needed move back to its 'true' position.

Most games and simulators provide a double precision matrix to position an object; then single precision facets are accurately placed relative to each other as they are all near the origin (000).
Geoffm is offline   Reply With Quote

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

All times are GMT -4. The time now is 03:53 PM.

AC3D Forum
(C) Inivis Limited 2020