Is It Open?

Roop Saini
iTwin.js
Published in
3 min readOct 29, 2020

iTwin.js is open-source.

“Nice! So people have been contributing to it?”

Not quite.

Yes, the source-code has been open to the public — people can copy it, modify it, but they can’t submit their changes. iTwin.js is an open platform…but truth be told, it’s only been half open.

Until today…

The source-code repository is now accepting changes! I gotta say…when I first found out, I was pretty psyched to make a contribution. Lucky for me, there was an issue out there that needed some love.

What was it? 😯

As you may already know, the iTwin Platform has the ability to take models from multiple domains— such as buildings and roadways— and combine them into a single iModel. For example — here is a roadway (in MicroStation) and a tiny building (in Revit):

We run them through the iTwin Synchronizer, and voila:

Wait a second!? I was expecting to see the building and roadway. What the heck just happened 😠

This all too embarrassing situation occurs when no models are listed in the default view — thus rendering an empty view. Previously, this has been a source of confusion for users…prompting some to question the very quality of their data.

So how does one prevent this calamity?

You can use my contribution :)

It’s called the ViewCreator

It gets all the models within an iModel — such as the tiny building and roadway — and generates a new default view. This view can then be passed into the Viewport to display the full contents of your iModel:

And just like that…gone are the days of empty views! All it took was a couple hundred lines of code.

And the best part: You can submit your changes too! Anytime you see an opportunity to improve or extend iModel.js, just fork the repo, make your change, and submit a pull request.

I’ll confess — in the case of the ViewCreator, I was naïve enough to submit the first draft of my code. Two years of hackathons, and I forgot all about code reviews.

It wasn’t that bad :)

To make the most of your reviews, don’t forget to follow the code guidelines, and add release tags (if needed). Here are some ways in which you can contribute to the repo:

Now that iTwin.js fully open…

We invite you to make your mark upon it.

-Roop, reporting live from the basement.

<- previous post | home | next post ->

--

--