On Sat, Mar 21, 2015 at 1:52 AM, Christopher Sean Morrison <brl...@mac.com>
wrote:
>
> On Mar 20, 2015, at 3:22 PM, Kalpit Thakkar <ceasy...@gmail.com> wrote:
>
> Now, if I import some model into MGED, which is an external model, will it
> also be broken down into a hierarchy by MGED, such that leaf nodes consist
> of basic primitives and the parent nodes are obtained by applying union,
> intersection or subtraction on the child nodes?
>
>
> This entirely depends on what the source geometry is, what representation
> format it’s in, how the importer is written, and what that translate to in
> our system. Imported geometry rarely consists of basic primitives, usually
> importing in as polygonal mesh geometry (e.g., our nmg or bot object types)
> or as NURBS boundary representation (i.e., our brep object type).
>
> That is, is every combination a hierarchical grouping of primitives, where
> leaf nodes are some core(basic) primitives?
> (I have based this doubt on the tree you have drawn using letters CAD in
> the Quick Ref Card)
>
>
> I’m not sure I fully understand your question. A combination object is a
> collection of objects and operators. The objects can be primitive objects
> and other combination objects. The operations describe what kind of
> grouping to perform. What doubt do you have about the card diagram? It
> shows you a visual tree with several primitive objects and a hierarchy of
> combination objections.
>
> Okay, so I was stuck here while I was trying to figure out how to find the
> centroid of the combinations, because I wasn't able to visualize how
> exactly a combination would look like in MGED. While talking to ``Erik on
> IRC right now, I got an idea of how to get the volume and surface area of a
> combination, well, to some extent atleast. The approach involves shooting
> rays on the object with square 1mmx1mm cells on the grid and the distance
> travelled by the ray inside the object will help me find the volume.
>
>
> I suggest actually going through one or two of the mged tutorials. I
> think there is confusion because you’re trying to understand terms without
> actually using the tools. Especially if you plan on writing code, you
> probably need some basic familiarity with mged, gqa, and rtweight.
>
> The approach you suggest is undesirable as it can fail on extremely small
> and large objects. If you need to sample, we have tools already that do
> this well — it’d be better to refactor them into an API that you query.
> For some combinations, ones comprising single primitives or disjoint
> objects, you wouldn’t need to sample at all and can evaluate an exact
> solution.
>
> Surface area would be found by tessellating the object and summing the
> areas of the triangle.
>
>
> This would be merely an approximation.
>
> If there is any mathematical alternative to finding the volume and surface
> area of combinations, it'll be really helpful. Centroid is still pending.
>
>
> You’re going to waste time trying to tackle too many things at once.
> Half-solutions are not at all useful. I suggest focusing on just one small
> incremental change/improvement, if you’re trying to develop a patch.
>
> Cheers!
> Sean
>
I'm sorry I'm rushing this too much. I am trying to develop my proposal for
the Object-Oriented C++ Geometry API project and I want to include adding
features like Centroid, Volume and Surface Area of the primitive in the
interface. I discussed with Daniel and he said, it should work for
combinations as well. So, I was trying to understand combinations and how
to implement these features in it's case.
I will look into the tools you mentioned here and do my homework.
I was a bit frustrated because I wasn't getting a clue as to what to do and
hence started asking confusing questions!
Sorry if this caused an inconvenience.
With Regards,
Kalpit Thakkar
PS : I'll come back after doing homework with better questions :)
>
> ------------------------------------------------------------------------------
> Dive into the World of Parallel Programming The Go Parallel Website,
> sponsored
> by Intel and developed in partnership with Slashdot Media, is your hub for
> all
> things parallel software development, from weekly thought leadership blogs
> to
> news, videos, case studies, tutorials and more. Take a look and join the
> conversation now. http://goparallel.sourceforge.net/
> _______________________________________________
> BRL-CAD Developer mailing list
> brlcad-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/brlcad-devel
>
>
------------------------------------------------------------------------------
Dive into the World of Parallel Programming The Go Parallel Website, sponsored
by Intel and developed in partnership with Slashdot Media, is your hub for all
things parallel software development, from weekly thought leadership blogs to
news, videos, case studies, tutorials and more. Take a look and join the
conversation now. http://goparallel.sourceforge.net/
_______________________________________________
BRL-CAD Developer mailing list
brlcad-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/brlcad-devel