Skip to main content
Solved

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

  • September 26, 2017
  • 5 replies
  • 146 views

karnil
Contributor
Forum|alt.badge.img+5

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

Best answer by daveatsafe

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.

View original
Did this help you find an answer to your question?

5 replies

geosander
Forum|alt.badge.img+7
  • September 26, 2017

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.


daveatsafe
Safer
Forum|alt.badge.img+19
  • Safer
  • Best Answer
  • September 26, 2017

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.


geosander
Forum|alt.badge.img+7
  • September 27, 2017
daveatsafe wrote:

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!

 

 


karnil
Contributor
Forum|alt.badge.img+5
  • Author
  • Contributor
  • September 27, 2017
daveatsafe wrote:

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


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings