How to take apart the Panasonic Toughbook CF-W2

From the archives. Good thing for the Wayback Machine.

1. 1 screw inside the CD/RW unit underneath the cover on left. Do this before you power down the unit. Otherwise you will have to force open the drive from the bottom.
2. 2 nut screws on the VGA connector on the top left side.
3. Take the plastic cover off the Wireless antenna near the Intel logo on the right side of the unit by prying the cover loose. Remove 2 screws at side of antenna.
4. Turn the notebook over.
5. 7 screws at back. Make a note of the screw positions in a piece of paper, since there are 3 long and 4 short screws.
6. 1 screw for the Memory Cover
7. 3 long screws holding the Honeycomb cover, next to the memory slot. These screws hold the keyboard.
8. 1 inside after the Honeycomb cover is removed.
9. Turn the unit over. Open the lid. Push The keyboard up from back under the battery. The top part comes up. Now lift up the keyboard. Pull the ribbon out underneath the TOUGHBOOK Sign. Unclip the ribbon from the unit very carefully.
10. 2 silver screws on inside just above the logo Intel Centrino under the keyboard
11. 6 black screws under the keyboard
12. Now close the lid and turn the unit over.
13. 4 screws holding the LCD Hinges at back (2 Screws each side).
14. Now slowly pull the back cover up.

Writing copy is like drawing a comic strip

Once, I remember reading that a cartoonist said that the important part of drawing a comic strip is not actually what’s in the panels themselves, but the space between the panels. The pictures that you draw are, in fact, just bookends and anchors to your readers’ imagination. If the reader can’t use your anchors to make the transition to the next panel through the use of their imagination, then you’ve failed as a cartoonist.

This is something we as comic strip/comic book readers tend not to notice, especially when it’s done well. It’s only glaringly obvious when you can’t follow the dialog or the action due to confusing camera angles between one panel to the next or a bad panel layout.

So it is with copy on your website, or an HN title submission. Like panels on a comic strip, copy is the anchor which you bookend your visitor’s understanding and imagination. If it’s not something that stirs their curiosity, or even better, their sense of imagination, then you’ve failed to carry them from one step to the next.

And as it is with a comic strip, you can’t be overt with the copy, nor should you lie to them. That’s when people get irked and call things link baits. When done right, people don’t even notice at all.

Knowing yourself

When I was younger, I often heard the phrase, “Know yourself”. I didn’t quite know what that meant. At the time, I thought, “Of course I know myself. I know that I like vanilla ice cream.” It wasn’t until I was older that I figured out there’s more to those two words.

What’s so important about knowing yourself? For one, at many points in your life, you’ll have to make decisions about your life and the lives of others. Should I take this job or should I work on this idea? Should I marry this girl or should I try to find another? Should I be the whistleblower or should I protect my family? Making these decisions is tough enough, as you oftentimes have incomplete information, your own biases, and peer pressure of others to mask you from thinking clearly. Knowing what you value will help make the decision process easier (though justifying it is another topic altogether).

In addition, the world has many different types of people in it that value different things. One way or another, they’re going to try to impose, coax, or try to convince you of their values to achieve their own goals. This happens with advertisements to buy a product, when someone asks you to go into business with them, or to go on that trip to Thailand. When your goals are aligned with theirs, then alright, high-fives all around and let’s execute. But when you are unsure of your own values, it’s easy make choices for yourself that are not actually aligned with your values. When you have a lack of alignment between your actions and your core values, it contributes to a lack of control in your life, which contributes to happiness.

So what should you know about yourself? I’m specifically talking about what you value, though Values is an often overloaded term. In this context, I mean it as not simply what you think is important, but the relative prioritization you’d give of one over another. If I asked you whether you value security, you might say ‘yes I do. I like knowing I’ll have a job next year’. And if I asked you whether you value progress, you might also say ‘yes, I like how technology moves forward to bring better standards of living’. But when security is pitted against progress, which would you choose? What if in order to make technological progress, old industries and markets disappear and people lose their jobs? What if it was your job on the line? Some might not find that decision so easy.

How would you go about discovering your prioritization of values? One way would be to take every combination of values and pit them against each other in an either-or contest. I did this exercise once, and it was not only tedious, but also relatively inaccurate. We have a tendency to lie to ourselves because of who we’d like to be (or who others would like us to be), rather than who we are. What we say is oftentimes not what we do.

How do we look at what we do in an honest light? One way is to put yourself in stressful situations and see how you react. We often don’t know what we’d do in a situation until we find ourselves in that actual scenario. You want to put yourself in situations where you are a bit intimidated but not in completely over your head, doing things that may be uncomfortable but will ultimately lead you to stretch yourself. Sometimes, we’re surprised by our own courage, acceptance, or kinkiness. Other times, we’re disappointed by our cowardice, lack of confidence, or our spitefulness.

When I finally connected the dots, I realized that’s why people choose to backpack around Europe or SE Asia. It’s an opportunity to put yourself in new and stressful situations where you don’t quite have all the solutions and will have to react to new situations. That’s how you find out whether you are okay flying by the seat of your pants or whether you like to have a plan; whether you’re too trusting of strangers or not quite trusting enough.

I see people miss this point all the time when they cargo-cult others’ path of self-exploration. I had a friend go to France to teach English, and she found herself doing the same things as she would have done back home–go to work, come home, eat microwave dinners in front of the TV. As can be expected, she reflected that it wasn’t much different living in France as it was living in the US. Similarly, I see people add to their bucket lists “run a marathon”, “go skydiving,” or “do a startup” simply as one more thing to check off, to serve as bragging rights to others, or mostly because they see other people doing it. [1]

Doing and experiencing things is a great start, but it’s more fruitful to learn something about yourself along the way. Those opportunities will not only inform later decisions in your life, but they will also enable you to see others with a keener eye. And that alone would be a pity to miss.

Time for the obligatory concluding quote.

He who controls others may be powerful, but he who has mastered himself is mightier still. — Lao-tzu

[1] Of course, there are some people who already know that they value experiences as a whole and go around gathering as many as they can. It’s perfectly fine if that is the case and they already know that about themselves.

Dalton’s point

Recently, Dalton Caldwell posted an Open Letter to Mark Zuckerburg. I was surprised and disappointed by this top level comment and others on Hacker News:

I don’t understand what you think Facebook did wrong. They intend to enter this new space, using their technology and their people. As a courtesy they offered to hire you / throw a lot of money at you. What would you have had them do instead? Not compete with you, because you’re a precious snow flake? Acquire you and treat you like a prima donna, giving you your own team and allowing you to take your own technical direction? – tjlc

I don’t get it either. Last week this guy wanted to make some sort of paid Open Twitter competitor. This week he’s mad at Facebook for offering to acquire his company rather than simply build a first party feature! – temphn

Then the rest of the thread were people arguing over the more granular points about hard-ball tactics. Or about whether it was kosher to invite someone to a meeting and then change the topic of discussion. Or whether a company has a right to do whatever they please with their technology.

It’s as if many readers read one part of the article and it offended some resemblance of ‘sensibility’ in them that they had to click the back button and start ranting about things that have nothing to do with the main point, and others take the bait to feed the trolls.

His open letter to Mark is not about being acu-hired at all, nor is it at all a public complaint what Facebook did, or any of the topics mentioned above. For a while now, the main thesis of his recent blog posts is what he calls an audacious idea:

Social media platforms should not be ad-supported.

Or, if you like it in his own words:

“My thesis is that if you purport to be a platform, your business model needs to reflect your platform-ness. Because if you instead have an ad business model, and you’re not making enough money, you can end up slaughtering your ecosystem.” – Dalton Caldwell

This blog post is a continuation of that theme. The TD; DR version of the open letter is:

Facebook employees are doing asshole things to 3rd party developers[1], even though Facebook calls itself a social media platform[2], not because they’re bad people, but due to bad incentives[3] caused by a search for ad-revenue[4].

[1] “Mark, I know for a fact that my experience was not an isolated incident. Several other startup founders & Facebook employees have told me that what I experienced was part of a systematic M&A “formula”. Your team doesn’t seem to understand that being “good negotiators” vs implying that you will destroy someone’s business built on your “open platform” are not the same thing.”

[2] “Mark, based on everything I know about you, I think you get all of this. It’s why you launched FB platform to begin with. Do remember how you used to always refer to Facebook as a “social utility”?

[3] “I don’t think you or your employees are bad people. I just think you constructed a business that has financial motivations that are not in-line with users & developers.” – Dalton

[4] “your “platform developer relations” executive made no attempt to defend my position. Rather, he explained that he was recently given ownership of App Center, and that because of new ad units they were building, he was now responsible for over $1B/year in ad revenue. The execs in the room made clear that the success of my product would be an impediment to your ad revenue financial goals,” – Dalton

In fact, I’d venture to say that he’s not so much mad at Facebook, or even really caring that Mark Zuckerberg reads it or not. It’s like if you had concerns about the direction education in America, you’d write an op ed piece that is creatively written as a letter that starts with “Dear President Obama”. Of course, you don’t actually expect President Obama to read it, but you do expect Americans that read it to understand your concern for the status of education in America and address your main thesis.

For Dalton, I suspect it’s another piece of proof for him that he’s on the right track about how social media platforms shouldn’t be ad-supported. Not only that he’s looking for other people that believes this thesis.

“The only way to get fulfillment is to help other people that believe what you believe.” – Simon Sinek

And I should add, Simon is very specific about what he means by “believe”:

“We want to go to work with people who understand us, who believe what we believe, who have a similar view of the world, that has nothing to do with their opinions and the differences that we share. That’s good. that’s called diversity. That’s called advantages to problem solving, which is we can all look at the same thing from different angle and come up with solutions. What I’m talking about is why should you help each other in the first place. What are you in the pursuit of?” – Simon Sinek [emphasis mine]

Dalton is in the pursuit of this crazy (gasp!) idea about a non-ad supported social media platform, and blogged about it repeatedly [a] [b] [c] [d]. He’s trying to find people who believes what he believes. He is proposing something that goes against the current tide and grain, because he believes it’s the way forward. He believes it’s something sustainable, a public good, and the springboard for further innovation. And when you find yourself in that situation, you need to find other people that believes what you believe to help you realize the vision of the future that betters us all.

Google services being axed? Sounds like a list of startup ideas.

Google services are being axed left and right, due to Larry Page’s continual focus on what-matters to his company, via advice from Steve Jobs. It’s not bad advice at all, and I think companies have cycles of both experimentation and focus. It just happens to be in the focus phase.

And when Google decides to axe a product, it’s probably worth asking why they axed it. Is it because it’s untenable or it’s no longer needed, like iGoogle? Or is it because it no longer fits into the strategy of company?

Google Bookmarks Lists, Google Friend Connect, Google Gears, Google Search Timeline, Google Wave, Knol, Renewable Energy Cheaper than Coal (RE<C), Aardvark, Desktop, Fast Flip, Google Maps API for Flash, Google Pack, Google Web Security, Image Labeler, Notebook, Sidewiki, Subscribed Links,Google Flu Vaccine Finder, Google Related, Google Sync for BlackBerry, mobile web app for Google Talk, One Pass, Patent Search, Picasa for Linux, Picasa Web Albums Uploader for Mac and Picasa Web Albums Plugin for iPhoto, and all Slide products.

I suspect that some of them here are perfectly good startup ideas that are worth reviewing. What are small potatoes for Google may just be a mountain for you.

What would be the best way for an aspiring programmer with not much prior experience to learn Javascript?

Someone asked me this question on Askolo

The best way to learn programming is to do it. I think there’s two tracks that you need to pursue: learn the fundamentals of programming (aka, the boring, but important stuff), and a project you want to do.

No one likes doing drills, but if you haven’t done programming before, you need the basics, like how to do if/then statements and loops. It’s like having to know what a steering wheel is before you drive. I suggest getting a javascript book for beginners.

Or if you’re a cheap bastard, you can start with which gives you examples you can play with right in the browser! It’s important that you play with the examples. That’s how you get to know how it works! Change something, see what it does!

The other half is to pick a simple project that you’d like to do. The idea is to pick something that’s not too hard for you (important!), but something you’re really really excited about building (double important!). It can be stuff like make every image in a webpage be upside down as a prank for your friends. Or implement this XKCD comic: I can’t really tell you what to pick, since you need to pick something exciting to you, so you’ll want to work on it, even when your friends ask you out for a kegger. But also make sure it’s doable. That’s hard to judge when you’re just starting out, but one way is to ask a programmer friend that can appreciate beginners. 

After you get the basics from w3schools, I’d say it’s important to learn JQuery.’s the sane was of manipulating the stuff you’d see on the page. 

After that, you’re ready to tackle:
I think it’s a really good tutorial on the little gotchas of Javascript. It may take a little while to get through it, but feel free to come back to it, as you work on other stuff.

Javascript is a surprisingly good language, but it has lots of warts. Learn about what the good parts are:

Remember to do the following when coding:
– Write a little, test a little. That way, you know what you changed since last time that broke it. Don’t try to write the entire thing all at once, and then run it. 
– Make sure you check that you’re not missing semicolons, and all your braces, parens, and brackets match. Computers are finicky.
– If you have questions or get stuck, search on They have lots of answers. 

Good luck!

Writing on the web has gone from “listen to me” to “ask me anything”

Writing on the web has taken many forms over the years. The earliest being geocities homepages, but first materialized as a format with blogging. Since then, blogging has spawned a lot of different forms, but adjusting its different properties. Limit the size of the message and make following easy, and you get Twitter. Make posting multimedia and reposting it easy, and you get Tumblr. Make it only about posting pictures on the go with filters with easy sharing on Twitter and Facebook, and you get Instagram.[1]

The other way to approach the problem of getting people to write on the web is a question and answers site. Before Quora, I honestly never gave much thought to Q&A sites, since all the ones I saw were pretty terrible, like Yahoo Answers. But when Quora came out a little over a year ago, I found it fun to read, since the answers tended to be thoughtful. Since then, Q&A has taken many forms, from AMA (Ask Me Anything) on Reddit to Formspring. [2]

I’ve not been posting here as much in the past week partially because I’ve been writing on a site called Askolo [3], which is another take on Q&A sites. Askolo is like formspring, where you can answer questions people ask you, but the questions and answers are more thoughtful. I’ve found both writing and reading on Askolo to be addicting to the point I needed to block the site when I’m trying to get work done.

Of course, your mileage may vary, but I found it attractive as a reader because I knew the other users on Askolo, but often times, I discovered things about them that didn’t know and wouldn’t have thought to ask. In addition, I can ask a question, and with enough votes of curiosity from other Askolians, they feel compelled to answer. A lot of the time, if someone was an expert or knew quite a bit about a particular area or field, I could ask them about it as well.

On the other side of the equation, I write on Askolo, because they’re what other people are interested in knowing about me or something I can answer. Curiously, I remembered something that Robert Scoble posted at about how he was wrong about Quora as a blogging service. Because Askolo is directed at specific people, I thought it was a good platform for doing lead gen on what blog posts to write. 

One of the unsaid things about blogging is that it’s a bit of work to write. And you have to do it for a long time in order to see conversations and social returns. In addition, you often don’t know what what topics to write about to generate readership. So the only recourse is to write a lot, about a variety of topics, keep track of what’s trending and write about that. With Askolo, people can vote on questions they’re curious about, so it acts as lead gen for blog post topics people would be interested in. 

As we got better at figuring out what the web was good for, we realized the web is really good at keeping us social with each other, despite naysayers in the 90’s. And as a consequence, it’s not total unique visitors that were important, but it was engagement that was quite important in keeping users around (which is why websites are getting more and more addicting).

That engagement happens when we can interact with others in a meaningful way around some type of digital artifact, whether it’s photos, tweet, blog post, or questions. And with blogs, the longstanding method of interaction was really just comments or writing your own blog post as a reply. So when you can ask someone questions on a blog-like platform, it opens up a new channel of meaningful interaction to drive engagement, and everyone gets more fun out of it.

So I think they’re on to something, but I’m not exactly sure where it’ll go. I think there’s a couple of different potential ways to go from lead gen for blogging to a dating site. As writing on the web has evolved from Blogger, to Twitter, to Quora, Askolo is an evolution in ways to write on the web, and it’ll be interesting to see where the space goes.

In the mean time, feel free to ask me questions on Askolo, or vote on questions you’d like to see answered, and I’ll do my best to answer them. Better answers will make it to this blog as a post. Happy asking!

[1] Of course, I’m over-simplifying. These aren’t the only reasons why those sites are successful.

[2] Quora’s not the first, but I’m too lazy to figure out which out of the three were the first. My point is that they’re all in the same category at around the same time.

[3] In full disclosure, I know the founders, I helped them beta test the site. 


Introducing Efronsitive–parametric 3D printable non-transitive dice

Two weeks ago, I found out about non-transitive dice from Hacker News. And I thought it would be a good simple project to build a 3D model for in OpenSCAD, after designing King’s Gambit, an open source 3D printable Chess set

It was definitely a lot easier to design than the chess set, and I managed to do it in an afternoon. I probably spent more time writing up the documentation and this blog post than I did actually designing the thing. 

The code repository is on github here. Feel free to fork the design and try to do other things with it, and send pull requests. 

What are non-transitive dice?

Non-transitive dice are a set of dice where no one dice has a better chance of winning head-to-head with another dice in the set. They’re like the rock-paper-scissors of the dice world.

The idea for them have been around since the 1970’s: Gardner, M. “Mathematical Games: The Paradox of the Nontransitive Dice and the Elusive Principle of Indifference.” Sci. Amer. 223 , 110-114, Dec. 1970.

When you look closely at the dice, they might have more than one face with the same number of pips (the little divets), or eve no pips at all. Some might have numbers above six as well. 

There are different sets of possible non-transitive dice, usually named after its inventor. The three I have implemented here are Efron, Grime, and Miwin. If you have others, feel free to fork, contribute, and send a pull request! 

Efron’s Dice


Efron’s dice are a set of four dice where each dice beats their predecessor by a probability of 2/3.

The dice is named and ordered by the color scheme where:

Blue > Magenta > Olive > Red > Blue

which means if you’re reading the wikipedia article, A corresponds to Blue, B to Magenta, C to Olive, and D to Red. The colors of the dice are in alphabetical order, to help you remember. This color scheme was adopted from here

Miwin’s Dice


Miwin’s dice are two sets of three dice each with the probability that it will have a higher number than another is 17/36; a lower number, 15/36.

Since there are only three dice, each dice will beat one and lose to the other on average.

The dice can be distinguished by color, or by the sum of their smallest two numbers. For example, the III dice in the Miwin set has faces 1 and 2 on it, which are the smallest two numbers on the dice. Add up 1 and 2, and you get 3, which is the name of that Miwin dice. Dices III, IV, and V, are in one set, and dices IX, X, and XI, are in the other.

These set of dice also has reverse non-transitivity. Normally, III beats IV. But if you remove the common faces, the dice reverses their intransitivity, meaning now IV beats III. This applies to the other two combinations of IV and V, and V and III.

Grime’s Dice

Grime’s dice is a set of 5 dice, each denoted by a color, where the order of which dice beats which is ordered in two ways:

Alphabetical order of the color's name
Blue > Magenta > Olive > Red > Yellow > Blue

By the length of each color's name
Red > Blue > Olive > Yellow > Magenta > Red

In general, the alphabetical chain is stronger than the word length chain. Overall, the average winning probability for one die is 63%

Like Miwin’s dice, Grime’s dice also has reverse non-transitivity. If you have two dice of each color, now the order for word length now flips so:

Magenta > Yellow > Olive > Blue > Red  >Magenta

With two dice, the chain ordered by word-length is stronger than the alphabetical chain. The average winning probability for two dice is 59%

Grime’s dice has other fascinating properties that I suggest you look at here.

Lessons Learned

I found that I spent most of my time writing in OpenSCAD doing refactoring. I’m not sure what the problem is yet, but it’s a symptom of some underlying problem with the programming language’s interface with the user. 

In addition, I also learned that you can put modules within another to help organize the code and not pollute the namespace, but there’s no way to access those modules outside of the containing module, so you can’t actually use it to namespace modules. I also leanred how to use default arguments in the module calls for friendlier programmer interface.

I also tried organizing the code so that there’s a src directory and a print directory, just like there’s a src/ and bin/ in software. However, it’s often not as simple as having a main.scad. Often times, demonstrating what it looks like assembled is different than arranging multiple pieces for printing. So I succumbed to the use of plate.scad to indicate that this is the file you should compile to STL to print. Sometimes, you have multiple plates, and you have to do all the compilation to STL by hand (unless I find a way to convert *.scad to *.stl in OpenSCAD on the command line), which makes it tedious. I think eventually, the printer driver software will allow you to arrange plates, but in the meantime, we’ll have to provide both a plate.scad and an assembly.scad.

Rounded corners are tedious to do. There are easier ways of programming rounded corners, by using the convex hull() or minkowski() methods, but both are so ridiculously slow at rendering (especially the latter), that it makes it pretty much impossible to use practically. 

Well, other than that, I’m looking for other simple projects to model. Have fun with the parametric dice, and send me a pull request!

A brand is a pointer


Unevolved Brands by Graham Smith via

As someone with an engineering background, I was always far more concerned with the features of the product I was building, rather than the hype and bullshit that gets built up by marketing. But eventually, I changed my mind about marketing. The practice of something and its intent are two separate things. 

The core intent of marketing is actually about clear communication and teaching others so they can understand your product, use your product, and stay with it. Given you actually have something of value for others to make their lives better, they will need help understanding how and why you’re able to do that. [1] 

Part of being able to clearly communicate your product is having a brand or a positioning. So what is a brand? Is it a great looking logo? Or great looking packaging? I’d argue that those are just manifestations of its core purpose:

A brand is essentially a pointer.

Just as in you have memory addresses pointing to other sections of memory, a brand is a pointer that uniquely refers to a product, whether it’s a 5 word description, a logo, commercial, or nowadays, an internet meme. Every time you think of solving a problem or doing an activity, chances are, you only think of one or two solutions. 

Where do you go if you want to play with toy bricks?
Where do you go if you want to see funny videos?
Where do you go if you want to review your personal finances?
Where do you go if you want to read rants about Apple?

When you’re describing your startup or your product to other people, it needs to be simple and succinct enough to write a pointer in their minds about a specific problem they need solved. So that the next time they want this problem solved, they think of your product. Or even better, the next time someone asks them how to solve a particular problem, they’ll be reminded of your product.

That’s why you so often hear the phrase, “It’s X for Y” when someone’s describing their startup. As clichéd as the phrase is, it’s effective in giving the listener a mental hook to hang their understanding on. 

But, “my product does more than that!” you might retort. Don’t fall into this trap of feeling sheepish that your product only solves one problem. Many startups fail because they don’t even manage to do that. Clearly, in the four examples I gave above, you can do far more with their products than what I described, but the four short problem descriptions above is what reminds you of those products. It gets your product’s foot in the door of someone’s mind so they can start exploring what else your product does. The enemy of most beginning products is not a lack of features, but obscurity. 

In addition, smart people can usually think a step or two out, but they need some basis to work from. When you’ve established “It’s X for Y” for your product in someone’s mind, they’re free to let their imagination fly. They’ll probably come up with more ideas and perspectives than you would have thought of. But if you never get them there, you won’t be able to reap the benefits of people’s enthusiasm and imagination. 

Lastly, having a pointer to your product helps with narrowing down your minimum viable product if you can describe it succinctly. Many times, when you’re in the early stages of product development, you’re not actually quite sure what you’re building as of yet. Having a short description goes a long way in focusing your efforts and help determine what your MVP should be. The less you can describe what the core functionality should be, the longer it will take for you to launch, and the longer it’ll take for you to get feedback on whether you’re even on track or not.

So think long and hard about how to whittle down what your product is suppose to do, if it can only do one thing. If you get stuck, If your product is useless if it doesn’t do X, then keep X. If your product is still useful without X, then cut X.

If you get stuck, think about control tower software. Despite it being very complicated and having lots of features, it’s only suppose to do one thing its core: land planes. Your product should just land planes too, by analogy. And the next time someone needs to land their plane, they’ll think of you.

[1] Marketing gets a bad rap because, often times people do marketing even when they have shitty products or products that are inherently harmful.

How to write modules with fallback default arguments in OpenSCAD

While refactoring King’s Gambit in OpenSCAD, I wanted to make a rounded-corner cylinder module that also behaved like the regular cylinder module. In the regular cylinder module, you can write arguments in a variety of ways.

cylinder(10, 10, 20);
cylinder(h = 10, r1 = 10, r2 = 20);
cylinder(h = 10, r=20);

As you see above, you can either pass in arguments by order (like most programming languages), or by name (like in Objective-C and passing hashes in Ruby). And if the argument “r” exists, it override the values for “r1” and “r2”.

I wanted to be able to write this kind of module as well. Of note, there is no pattern matching in OpenSCAD, there are no variables and only constants in OpenSCAD, and there is no nil or null in OpenSCAD. There is an undefined state that constants can be in, but no test for their undef state, since it’s unspecified. Thus, we’re left with using default arguments as a work around. This close as I have figured it out:

module rounded_cylinder(h, r1, r2, r = "undefined") {
  module helper(h, r1, r2) {
    // I'm just going to render a regular cylinder here for simplicity. 
    // Pretend this section has multiple lines of code.
    cylinder(h, r1, r2);

  if (r == "undefined") {
    helper(h, r1, r2);
  } else {
    helper(h, r, r);

rounded_cylinder(4, 4, 2);
translate([10, 0, 0]) rounded_cylinder(4, r = 4);
translate([20, 0, 0]) rounded_cylinder(4, r1 = 4, r2 = 2);
translate([30, 0, 0]) rounded_cylinder(4, r1 = 4);
translate([40, 0, 0]) rounded_cylinder(4, r2 = 2);
translate([50, 0, 0]) rounded_cylinder(4);


As you can see, I set the default value of “r” to “undefined”, and then tested for whether it’s undefined or not, and rendered the correct helper accordingly, since there’s no actual test for whether a variable is undefined or not.

Note that because there are no variables in OpenSCAD, all constants need to be defined in the beginning of a module. Thus, you can’t redefine constants inside the two branches of the if statement.

Also note that you can either repeat the same code twice in each branch of the if statement, or you can define a helper module inside rounded_cylinder and make a call to it in each branch, as shown above. The helper module only exists within the scope of rounded_cylinder and won’t pollute the global namespace.