# How to combine threeJS with AI tools

**URL:** <https://discourse.threejs.org/t/how-to-combine-threejs-with-ai-tools/58186>\
**Category:** Questions\
**Tags:** ai, geometry\
**Created:** [November 15, 2023, 3:29pm UTC](https://discourse.threejs.org/t/how-to-combine-threejs-with-ai-tools/58186 "2023-11-15T15:29:14Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Nemines](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/nemines/32/16023_2.png) [@Nemines](https://discourse.threejs.org/u/Nemines)\
**Post date:** [November 15, 2023, 3:29pm UTC](https://discourse.threejs.org/t/how-to-combine-threejs-with-ai-tools/58186/1 "2023-11-15T15:29:14Z")

</div>

Hi Dear Three Enthusiasts,

I was wondering how to combine threejs with AI tools. For example, if I add a cuboid in the ThreeJS scene, can I combine that with some AI tool (Python based for ex.) To give me automatically the different dimensions of the cuboid (in all dimensions : a, b and c).

This would be interesting instead of manually measure these distances by some distance tool in threeJS.

Let me know your thoughts

Thank you

---

<div class="post-metadata">

**Author:** ![mjurczyk](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/mjurczyk/32/10995_2.png) [@mjurczyk](https://discourse.threejs.org/u/mjurczyk)\
**Post date:** [November 15, 2023, 5:48pm UTC](https://discourse.threejs.org/t/how-to-combine-threejs-with-ai-tools/58186/2 "2023-11-15T17:48:39Z")

</div>

> [@Nemines](#):
>
> I was wondering how to combine threejs with AI tools.

1. Create a webapp (in Three or anything else, since the rendering part will likely not affect the AI much.)
2. Create [an API in Python](https://fastapi.tiangolo.com/), exposing web endpoints that take in some data, run it through your AI pipeline, and return the result back to the webapp.

As to how and what data you’d send to the Python API - depends on the AI models you’d be using 👀 The GPT-like models have quite poor spatial-awareness, so they may not be very effective, unless you’d transform your scene into vectors and just ask GPT to do calculations on them (I’d still test it thoroughly for longer, continuous conversations - even when given conversation history, GPT often doesn’t see proper relations within 3D spaces, and will not notice it unless you point it out.)

---

<div class="post-metadata">

**Author:** ![Nemines](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/nemines/32/16023_2.png) [@Nemines](https://discourse.threejs.org/u/Nemines)\
**Post date:** [November 16, 2023, 2:35am UTC](https://discourse.threejs.org/t/how-to-combine-threejs-with-ai-tools/58186/3 "2023-11-16T02:35:21Z")

</div>

Thanks for your input mjurczyk

It seems that the current AI tools are still behind when it comes to 3D spatial recognition and reasoning.

I will make these commands/algorithm manually rather than relying on AI for now…
