BrainBlitz.org

September 30, 2008

BoxCAD now dumping AS3

Filed under: BoxCAD — Tags: , , , , — Anthony @ 5:50 am

Well, after many moons of delay, BoxCAD now generates pristine AS3 code. Only for fundamental objects and constraints (none of the fancy stuff yet, like particle engines/controllers/etc), but still a very useful subset of Box2D’s functionality.

Here’s a clip of the code output from the MoonTank file:


// New Polygon Shape & Body.

polygonDef = new b2PolygonDef();

polygonDef.vertexCount = 4;

polygonDef.vertices[0].Set(0.6000000000000005, -0.19999999999999996);

polygonDef.vertices[1].Set(0.6000000000000005, 0.19999999999999996);

polygonDef.vertices[2].Set(-0.6000000000000005, 0.19999999999999996);

polygonDef.vertices[3].Set(-0.6000000000000005, -0.19999999999999996);

polygonDef.friction = 0.2;

polygonDef.restitution = 0.4;

polygonDef.density = 1;

polygonDef.filter.groupIndex = -1;

bodyDef = new b2BodyDef();

bodyDef.position = new b2Vec2(4.056582535099032, 18.045220905705396);

bodyDef.angle = 0.41509286801864664;

newBody = m_world.CreateBody(bodyDef);

newBody.CreateShape(polygonDef);

newBody.SetMassFromShapes();

arrBodyList["30075"] = newBody;

 

// New Polygon Shape & Body.

polygonDef = new b2PolygonDef();

polygonDef.vertexCount = 4;

polygonDef.vertices[0].Set(0.6000000000000005, -0.19999999999999996);

polygonDef.vertices[1].Set(0.6000000000000005, 0.19999999999999996);

polygonDef.vertices[2].Set(-0.6000000000000005, 0.19999999999999996);

polygonDef.vertices[3].Set(-0.6000000000000005, -0.19999999999999996);

polygonDef.friction = 0.2;

polygonDef.restitution = 0.4;

polygonDef.density = 1;

polygonDef.filter.groupIndex = -1;

bodyDef = new b2BodyDef();

bodyDef.position = new b2Vec2(3.08373731317662, 17.90830170541888);

bodyDef.angle = -0.1395542297981954;

newBody = m_world.CreateBody(bodyDef);

newBody.CreateShape(polygonDef);

newBody.SetMassFromShapes();

arrBodyList["29906"] = newBody;

 

// New Revolute Joint.

rJointDef = new b2RevoluteJointDef();

rJointDef.Initialize(arrBodyList['30118'], arrBodyList['30120'], new b2Vec2(9.062264928353713, 20.28247519314447));

rJointDef.enableLimit = true;

rJointDef.lowerAngle = 0;

rJointDef.upperAngle = 0;

m_world.CreateJoint(rJointDef);

 

 

// New Revolute Joint.

rJointDef = new b2RevoluteJointDef();

rJointDef.Initialize(arrBodyList['30114'], arrBodyList['30118'], new b2Vec2(3.3360183210518954, 19.479990925312997));

rJointDef.enableLimit = false;

rJointDef.lowerAngle = 0;

rJointDef.upperAngle = 0;

m_world.CreateJoint(rJointDef);

That is two tread segments and two revolute joints. Imagine doing 20 tread segments by hand….

To make the development of flash physics apps even easier – here is a basic application skeleton. It supplies a convenient home, with basic mouse interaction, for BoxCAD’s output.

BoxCAD, of course, can be found on the main BoxCAD page.

  • Print this article!
  • Digg
  • del.icio.us
  • Facebook
  • Google Bookmarks
  • StumbleUpon
  • Yahoo! Bookmarks

September 25, 2008

[Engineering] Office Tidbits

Filed under: CAD — Tags: , — Anthony @ 2:40 pm

 

  • Observation: You  know you’ve been spending too much time on the computer if you spill coffee on your khaki pants, and your first impulse is “CTRL Z.”

 

  • Tip: Using MODEMACRO to mess with coworkers
    Try typing “modemacro” into the AutoCAD command line. You will be prompted to enter a new value. Type something in, and press enter. Now look at the very left side of AutoCAD’s status bar – you should see the text you just entered. This is a great way to confuse people or spread propaganda.

For example, you might put “Give Johnny a Raise” on your Boss’ status bar (consider changing “Johnny” to your own name). Or a sinister message on a coworkers status bar – you know, “I’m watching you” or “d0 y0u f33L 1ucKy?” or something.

If you’re really ambitious, you can write a very simple lisp routine to read a text file from the server when AutoCAD starts up, and insert the contents of that file into the MODEMACRO variable. Now you can set messages on anyone’s computer without having to access it all the time (just once initially).

If you want it to be REAL dynamic – set your lisp routine to redefine a common command (zoom?), such that the file is copied to the status bar, then the original command executes as normal.

 

  • Observation: You know you’re Generation X (or younger) if you open your email, write a carefully thought out message to a colleague and send it, and your colleague answers you a minute later. Verbally. From 12 feet away.

 

  • Definition: “Office Meeting” : A time to fellowship with your coworkers over donuts, listen to stories from the resident Veteran Surveyor, discuss American Idol, or place fantasy football bets.

 

  • Observation: You know you’re working in a Civil firm if you hear phrases such as:
    • “Go ahead and nudge that drywell to the right a bit.”
    • “Beat to fit, paint to match.”
    • “Just pound it in there.”
    • “Architects mess everything up.”

 

  • Observation: You know you’re working in an Architectural firm if:
    • You tell the project manager the building doesn’t fit within the setbacks, and he says: “No problem. Grab that property line there… yes, now drag that grip just a bit to the left… “
    • You tweak property lines because 90-degree angles are beautiful.
    • You spend 80% of your time on important  issues such as tile patterns, the shape of sign lettering, wall colors, etc, and 20% of your time on minor issues such as building dimensions and wall sections.

 

  • Tip: The quickest way to find the Civil section in a large, multi-discipline set of plans is to rapidly flick through it, stopping when your eye catches what appears to be a child’s random scribbles on the page. This will most likely be the Utility Plan.

 

  • Tip: Consider adding this note to any general notes you place on each page: “Revision clouds are not to be physically constructed.” Why? You never know.

 

  • Observation: “The Ghost on the Network”
    It is an all-to-common occurrence for a drafter to leave a drawing pristine and clean (layer states set, zoomed to extents, etc), only to come in the next morning to find what can only be described as a virtual disaster area. Usually unexplained, this phenomena is generally blamed on the “Network Ghost.”

A recent study, however, points the finger elsewhere…The Boss.”I just went in real quick to make a couple of minor edits.”

 

  • Tip: Clandestine Chatting within AutoCAD
    So, lunch break has ended, but the political conversation with your coworker was just getting good and heated. What to do? Create a drawing on the network with a simple mtext message in it. You and said coworker xref the drawing into whatever you’re currently working on. Take turns doing an “Edit XREF in place”, and simply reload when you get the notification that the xref has been modified.
  • Notes:
    • It’s rude and confusing to post more than one message consecutively. You must alternate.
    • It is recommended that you put the mtext object on a non-printing layer. Otherwise you’re just begging for humiliation – when the day comes that your message is inadvertently plotted, and suddenly the whole office knows all about your “secret problem.” Or worse – your emotionally unstable coworker reads all the mean things you said about him.

 

  • Definition: “Rapid Topic Shifting” (RTS’ing)
    RTS’ing is a powerful technique for avoiding trouble with the Office Authorities. It is the practice of shifting seamlessly from any given topic to a work-related topic. For example:

“Apparently Paula was hitting on Simon again. I don’t know what she sees in him… he’s so rude. Did you hear what he said to that one girl? ‘You should ask your vocal coach for a full refund.’ She started the invert will have to shift down a couple inches though, to maintain minimum slope. It’d probably be easier to just route the whole thing through an easement…”

Simple in theory, the technique requires practice for smooth execution – unless you’re one of those clever, quick-witted folks.

And practice you should. Nothing says “Hey Boss, I am a bad employee. Don’t give me a raise” quite as effectively as going completely silent the moment The Boss walks in.

  • Print this article!
  • Digg
  • del.icio.us
  • Facebook
  • Google Bookmarks
  • StumbleUpon
  • Yahoo! Bookmarks

September 19, 2008

AutoCAD’s Evil F1

Filed under: CAD — Anthony @ 10:41 pm

You’re in the zone. Your vision has tunneled to the screen, and nothing else happening around you even starts to penetrate your consciousness. Your left hand is moving with such fluid grace that the only indication of how much is actually happening is the rapid “clickclickclickclickclick…” of the keys. Your right hand on the mouse – the cursor moving to menu items before the menu has even opened. The only thing slowing YOU down is your 4Ghz dual core, water-cooled CPU.

 Then it happens.

The universe stops expanding.

Our galaxy stops spiraling.

Earth stops dead in it’s tracks.

The sun hides behind a heavy, gray cloud.

The birds outside instantly go silent.

You stare at the screen in horror. In the midst of your finger gymnastics, you slightly miscalculated the position of your finger, and instead of hitting “escape,” you hit “f1.”

And the world froze.

The only break in the eerie silence is the sound of your hard-drive, loading what must be terabytes of data to start up AutoCAD’s Help file.

A second ticks by. The universe is holding it’s breath.

Still the hard-drive whirs away.

Another second. An animal-like rage wells up inside you. The cursor jumps spatistically on the screen as you whip the mouse back and forth, trying desperately to regain control.

Denied.

Another second.

You grimace at the screen, grinding your teeth, kicking the wall underneath the desk.

Finally – the Help window pops up. Before it has even fully displayed, you’ve clicked the close button a dozen times.

A few milliseconds later, AutoCAD is back under your command. But it’s too late. Your drafter’s spirit has been crushed, and you spend the rest of the day hitting “refresh” on your email inbox.

***

Don’t let this happen to you again.

The F1 fix for AutoCAD 2005-
The F1 fix for AutoCAD 2006+

  • Print this article!
  • Digg
  • del.icio.us
  • Facebook
  • Google Bookmarks
  • StumbleUpon
  • Yahoo! Bookmarks

September 18, 2008

BoxCAD Update & New Logo

Filed under: BoxCAD — Anthony @ 8:51 am

Nothing is quite as frustrating as not being able to find the time to clean up the last 0.1% of a large project… such that it’s actually usable.

There’s a bit of a conundrum here though. If you’re like me, and are very excitable at the thought of adding additional features – you know that the last 0.1% is ALWAYS there. :D

Anyway, at this point, I’ve suspended work on BoxCAD. I simply need to focus on other things for the time being. But it is by no means abandoned, and abstaining is maddening for me. As soon as it is remotely possible, I will fix code-dumping and the weird cursor problems.

And once there is a working version – it’s overhaul time. There are some modifications I’ll be making to the overall architecture of the program which will reduce bugs, a lot of new functionality, and a new face…

Thank you to Rolf Brocke (Deviant Art page) for creating this logo (not to mention loads of other very useful, less tangible input).

  • Print this article!
  • Digg
  • del.icio.us
  • Facebook
  • Google Bookmarks
  • StumbleUpon
  • Yahoo! Bookmarks
Older Posts »

Powered by WordPress