Question about Multiple Geometries

13 views
Skip to first unread message

Mike Henry

unread,
Sep 19, 2019, 1:54:35 AM9/19/19
to fresnel-users
I had a question about this page with regards about this quote:
For fast performance, try to condense the scene down to as few geometries with as many primitives as possible. Multiple geometries allow for different materials to be applied to the same type of geometry and for different types of geometry in the same scene.
If I have a system where I'm rendering the simulation box using fresnel.geometry.Cylinder and bonds also using Cylinder,should I only make one instance of the geometry instead of two? I'm close to having an example to contribute but want to make sure its following best practices. What I'm doing now is this:
box_edge = fresnel.geometry.Cylinder(scene, N=N_edges)
bonds = fresnel.geometry.Cylinder(scene, N=N_bonds)

Joshua A. Anderson

unread,
Sep 19, 2019, 7:36:28 AM9/19/19
to fresne...@googlegroups.com
Mike,

Using one geometry for edges and one for bonds is fine. You might likely
want to use a different material for each of them. That comment is
intended to warn users away from representing e.g. 1000 bonds each with
their own 1-cylinder Geometry object.

If you have generic code that can turn a box definition into cylinders,
that would be a welcome contribution. It is a common enough use case
that it is worth adding `Geometry.SimulationBox` as a subclass of
`Geometry.Cylinder` with tailored initialization routines.

---
Joshua A. Anderson, Ph.D.
Research Area Specialist, Chemical Engineering, University of Michigan
http://www-personal.umich.edu/~joaander/

On 9/19/19 1:54 AM, Mike Henry wrote:
> I had a question about this page
> <https://fresnel.readthedocs.io/en/stable/examples/02-Advanced-topics/00-Multiple-geometries.html#Multiple-geometries>
> --
> You received this message because you are subscribed to the Google
> Groups "fresnel-users" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to fresnel-user...@googlegroups.com
> <mailto:fresnel-user...@googlegroups.com>.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/fresnel-users/acb4fc4e-7172-45c5-904c-d493f616ff3e%40googlegroups.com
> <https://groups.google.com/d/msgid/fresnel-users/acb4fc4e-7172-45c5-904c-d493f616ff3e%40googlegroups.com?utm_medium=email&utm_source=footer>.

Mike Henry

unread,
Sep 19, 2019, 2:30:30 PM9/19/19
to fresne...@googlegroups.com
Sounds good, I need to generalize my code to work for parallelepipeds but once that's working, I will submit a PR.

To unsubscribe from this group and stop receiving emails from it, send an email to fresnel-user...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/fresnel-users/3c68b405-58ae-602a-d896-b9af110f6cb9%40umich.edu.


--
Mike Henry
PhD Candidate
He/Him/His
Reply all
Reply to author
Forward
0 new messages