Solved

How do I generate instantiated 3D geometry on a set of points?

  • 26 September 2017
  • 5 replies
  • 27 views

Badge

Hello!

I have a set of points representing the location of the tree trunks. I also have a 3D model of a tree that i want to be copied to each of the points locations. And here is the tricky part, I need them to be instanced geometries, so they do not require to much space (and rendering power) when I export to fbx, skp and dwg.

I tried to read up on the GeometryInstantiator-node but I must admit, I don't quite follow what it is supposed to do. Is there an example for this availible anywhere or do anyone have a clue?

Here is a screendump of my script, but it only manages to place the trees as individual models which creates a 30MB file from copies of a mere 15KB geometry-asset.:

Sincerely,

Robin Nilsson

icon

Best answer by daveatsafe 27 September 2017, 00:18

View original

5 replies

Badge +7

Hi @karnil,

To cut right to the chase, this is how you could do it:

You should not use the GeometryInstantiator here, as it does the exact opposite of what you want to achieve: it "flattens" a geometry instance (which is called "instantiation"), so that the transformation matrix is applied and each instance becomes its own independent geometry, which could take up a lot of memory.

To add your tree into FME's internal library of reusable textures, appearances, rasters and geometry definitions, you have to use the SharedItemAdder. This will give you an ID, which can be merged onto the point features. Then, use the SharedItemIDSetter to set the ID of the geometry definition to your point, so that the tree instance is positioned there. Better read the documentation of that last transformer, as it provides some useful additional information!

Hope this works for you.

PS: Don't remove the geometry on your points (or trees for that matter) like in your example! The SharedItemIDSetter uses this. Also, the stuff in the purple bookmark is unnecessary: you only need to add 1 tree (of each kind) to the library.

Userlevel 2
Badge +17

Hi @karnil,

I have created a Knowledge Center article illustrating how to replace points with an instanced model, which you can find at Creating and using geometry instances.

Badge +7

Hi @karnil,

I have created a Knowledge Center article illustrating how to replace points with an instanced model, which you can find at Creating and using geometry instances.

Nice article! Didn't know it existed!

 

 

Badge

Hi @karnil,

I have created a Knowledge Center article illustrating how to replace points with an instanced model, which you can find at Creating and using geometry instances.

Thank you both DaveAtSafe and sanders for fantastic replies!

 

 

It works as a charm (in FME 2017). I notided that the FeatureMerger node did not work as you intended in FME 2016 which is why I made such a messy hack with a global Counter and a cloner in my test (there is probably a better way to do it in 2016 too). But I have moved to 2017 now so no worries there on my part.

 

 

sorry to revive this tread, but this method does not work for me, I am not sure why...Do you have any ideas? Thank you!!

image.png

Reply