Skip to main content

Improvements, additions and fixes

New in the Twinfinity API

In the first week of May we released a new version of the @twinfinity/core (4.1.0) and this new update contains some really nice features. In this post we break down the changes, show you some examples and give you some background to what has been changed and how it can help you when using the Twinfinity API.

news_xml

Publcerad:
15 May 2024

Author:
Tobias Svenberg

Lets just make it easier

Lazy loading

We’ve introduced lazy loading, this means that it is no longer necessary to apply visual changes as before. When you make changes they will be applied automatically. This also means that geometries will be loaded and unloaded as you go improving overall performance.

IfcClasses

We also added a new and improved API for working with BimIfcClass which makes it easier and more intuitive to, in a performant way, detect what ifc class and type (category) an IfcProduct has. Check out the example playgrounds below to give it a try.

Units!

The IfcProperties now have units, if specified in the IFC, will now carry over to your digital twin, you will find the unit on the property in the API. This will allow you to add units to numerical values in your site or app when applicable. You will need to reparse your files for this to take effect.

… and look better

No more war of the ants!

When it comes to rendering some really nice bug fixes and features have been added with this version. First of all we’ve tracked down and solved the bug that in certain cases gave objects a look of static tv noise. This was something that was really taking away from the user experience and we are happy that this is now resolved.

 

   

Normal… normals?

As you may have experienced, especially in piping and duct models, the normals were pointing in the wrong direction creating either objects that looked like they were turned inside out or when turning backface culling off being almost black. This has now been addressed so when turning backface culling off, like this:

api.viewer.performance.isBackfaceCullingEnabled = false;

the model will now look correct. Please note that disabling backface culling may have an effect on performance.

Faulty normals

Before

You can see on the the toilets and the metal sink that the normals are broken. Normals are how the graphics card know what direction a surface is visible in. In this case the normals are pointing in the wrong direction giving the water tank of the toilets and inverted look and if you turned backface culling enabled, the geometries would be very dark and not have the correct color.

After

Here, with backface disabled, the geometries now look whole and have the correct color. Please note that disabling backface culling may have a negative effect on performance.

FixedNormals

The colors, look at the colors!

Introducing HSV

In this release we introduce the possibility to use HSV in your scenes. HSV which stands for Hue, Saturation, Value is an alternative color model that, when enabled, allows for more control of how the colors of your scene turn out.

   

Make your scene more vibrant

Hue controls the overall color of the scene allowing you to add a tint to the entire scene. Saturation allows you to controll how vibrant your colors are to be and finally the Value controls the overall brightness of the scene.

By leveraging HSV like this you can get colors that are closer to the actual RGB value in the rendered scene.

RGB without HSV adjustments

Before

The colors shown here are without the new possibility of adjusting the HSV values.

After

These are the same colors with adjustments to the HSV values. You can see that with this adjustments the resulting color displayed is much closer to the RGB values given.

HSV adjusted colors

Playground examples

Try it yourself

We always try to show you what we’ve done and how it works and the Twinfinity Playground is the perfect place for us to showcase our updates, and for you to play around with the code to get a feel for the new functionallity.

Here is a playground showing some of the changes we’ve made in this version:

Twinfinity Playground showcasing changes in 4.1.0

Just as I was writing this, Christoffer from our dev team sent me this awesome playground showcasing the HSV changes in a more… colorful way

Twinfinity Playground - HSV Disco!

Find out more

Lets talk!

For more information about the Twinfinity API check out help.twinfinity.com and docs.twinfinity.com. If you want to try it out for yourself the quickest way is to just visist our playground at playground.twinfinity.dev.

If you are considering Twinfinity for your digital twin project, app or website you can reach us by booking a demo. Make sure to add a comment what it is you are interested in so that we can meet your needs as best we can.

All the best! Have fun out there

/Tobias

More blog posts

View all blogs
Improvements, additions and fixes

New in the Twinfinity API

In the first week of May we released a new version of the @twinfinity/core (4.1.0) and this new update contains some...

news_xml
Making it easy to get started

Introducing @twinfinity/templates

Getting started developing functionality towards your digital twin or integrating Twinfinity into your app should be...

npm
Leveraging Twinfinity, BabylonJS and WebXR

VR for your digital twin? – Sure! No problem!

Did you know that experiencing your digital twin in virtual reality is easily achievable through the combined powers of...

Meta