replmarks and mirroring

Hi!

On may way using replmarks and instances to split down a large model, I found a problem that makes the use of the replmark tool quite hard. I use this to build the model from lots of small files, which are exported from CAD. The markerfiles are generated by replacing the external references with triangles. Works really fine.

The replmarks manpage says: "The longest side is the hypoteneuse, the second longest side is the x’-axis, and the third longest side indicates the direction of the y’-axis. Any additional sides will be ignored (ie. a quadrilateral may be used instead of a triangle if the extra side is small). The z’-axis is determined by the cross product of the x’ and y’ axes, and the origin is the common vertex between x’ and y’." This just brings one limitation - I cannot define mirroring with this kind of markers. In my CAD, the mirrored References give mirrored triangles, fine, but radiance won't mirror the instance geometry, but (z' as cross product of x' and y') will rotate it, so that it is upside down in the radiance scene.

Is there any way to circumvent this problem? It is quite bad to be unable to use mirroring in CAD, and makes the use of markerfiles difficult. I wonder why z' is not determined from the surface normal. Is there a reason not to use it, is it just to avoid further confusion (surface normals are usually where they shouldn't go;-) ?

TIA+CU Lars.

···

--
Lars O. Grobe
[email protected]

the simplest and quickest thing is to use two different geometries:
the mirrored (xform -I) and the default (from acad).
...then replmark separately the two geometries.
hope it helps
giulio

···

-----Original Message-----
From: Lars O. Grobe [mailto:[email protected]]
Sent: 09 May 2004 23:11
To: [email protected]
Subject: [Radiance-general] replmarks and mirroring

Hi!

On may way using replmarks and instances to split down a large model, I
found a problem that makes the use of the replmark tool quite hard. I
use this to build the model from lots of small files, which are
exported from CAD. The markerfiles are generated by replacing the
external references with triangles. Works really fine.

The replmarks manpage says: "The longest side is the hypoteneuse, the
second longest side is the x’-axis, and the third longest side
indicates the direction of the y’-axis. Any additional sides will be
ignored (ie. a quadrilateral may be used instead of a triangle if the
extra side is small). The z’-axis is determined by the cross product of
the x’ and y’ axes, and the origin is the common vertex between x’ and
y’." This just brings one limitation - I cannot define mirroring with
this kind of markers. In my CAD, the mirrored References give mirrored
triangles, fine, but radiance won't mirror the instance geometry, but
(z' as cross product of x' and y') will rotate it, so that it is upside
down in the radiance scene.

Is there any way to circumvent this problem? It is quite bad to be
unable to use mirroring in CAD, and makes the use of markerfiles
difficult. I wonder why z' is not determined from the surface normal.
Is there a reason not to use it, is it just to avoid further confusion
(surface normals are usually where they shouldn't go;-) ?

TIA+CU Lars.
--
Lars O. Grobe
[email protected]

_______________________________________________
Radiance-general mailing list
[email protected]
http://www.radiance-online.org/mailman/listinfo/radiance-general

___________________________________________________________________
Electronic mail messages entering and leaving Arup business
systems are scanned for acceptability of content and viruses.

Hi,

yes, of course you are right. However, the idea is to reuse geometry when possible (and I have hundreds of objects which are placed by replmarks) and stay as close as possible to the cad packages. I wanted to ask as replmarks seams to be just for that goal ;). The integration of CAD and radiance without the need of writing radiance scene files manually is sometimes important... That's why I wonder if it would make sense to use surface normals of the triangles in replmarks - and add mirroring functionality that way.

Thanks+CU Lars.

···

--
Lars O. Grobe
[email protected]

Hi Lars,

If you mirror a marker triangle in cad (for example autocad), then the normal ends up pointing the opposite direction. Thus in radiance if you use a set of markers that include mirrored and unmirrored triangles then some of your instance objects will actually point down. One way to resolve this is to use two sets of markers (as previously pointed out in another email). If you create a mirrored instance of the object, then you are actually reusing the object geometry and conserving memory. The way to do this is create an compiled octree version of the object and then create an instance that mirrors it appropriately around x y or z as follows:

void instance foo.mirror
6 foo.oct -m<x,y, or z> -t xt yt zt
0

Since you are simply resuing foo.oct then you conserve the memory. I must admit that I have to play around with -m<x,y,z> to figure out how the object mirrors correctly and you may need to transform the object to get the position to work out with respect to your marker.

-Jack

Lars O. Grobe wrote:

···

Hi,

yes, of course you are right. However, the idea is to reuse geometry when possible (and I have hundreds of objects which are placed by replmarks) and stay as close as possible to the cad packages. I wanted to ask as replmarks seams to be just for that goal ;). The integration of CAD and radiance without the need of writing radiance scene files manually is sometimes important... That's why I wonder if it would make sense to use surface normals of the triangles in replmarks - and add mirroring functionality that way.

Thanks+CU Lars.
--
Lars O. Grobe
[email protected]

_______________________________________________
Radiance-general mailing list
[email protected]
http://www.radiance-online.org/mailman/listinfo/radiance-general

--
# John E. de Valpine
# president
#
# visarc incorporated
# http://www.visarc.com
#
# channeling technology for superior design and construction

Hi Jack!

If you mirror a marker triangle in cad (for example autocad), then the normal ends up pointing the opposite direction.

Interesting, in formZ that doesn't happen - the normal stays "up". I am not sure if formZ behaves correctly here, however, this would be the way to get mirroring information attached to the triangle.

Thanks+CU Lars.

···

--
Lars O. Grobe, [email protected], ++90-212-2458330

Kardesler Apartment, Turnacibasi Sokak 28
Galatasaray - Beyoglu, 34433 Istanbul

Lars O. Grobe wrote:

Hi Jack!

If you mirror a marker triangle in cad (for example autocad), then the normal ends up pointing the opposite direction.

Interesting, in formZ that doesn't happen - the normal stays "up". I am not sure if formZ behaves correctly here, however, this would be the way to get mirroring information attached to the triangle.

if you look into the mirror, you don't see yourself upside down, so I guess that formZ behaves correctly in leaving the normal unchanged during mirroring :slight_smile:

-cb

Hi Carsten, hi list!

if you look into the mirror, you don't see yourself upside down, so I guess that formZ behaves correctly in leaving the normal unchanged during mirroring :slight_smile:

In fact, it was what I had guessed. However, I wanted to be sure. Also, I wonder if there is any reason why the surface normal information is not used from the triangle.

I think, if I replace the call to fcross() in replmarks.c by a routine that aligns the z-achsis to the surface normal, mirroring transformations should be supported by replmarks, right? Is there a function to get the direction of the surface normal defined that I could use (I am sure it is, I just don't know where :wink: ?

Such a feature in replmarks would be very useful for me, as I could use just the triangle markers I have and I would not have to search for mirrored objects in the whole model, which would certainly introduce errors as I am rather sure that I would miss some objects.

CU Lars.

···

--
Lars O. Grobe
[email protected]

It seems to me that whatever convention you decide upon for mirroring objects with replmarks, you are going to have to deal with some ambiguity. If you say that a downward pointing normal means the object gets mirrored, how do you know which axis to mirror? There are three choices, and all of them result in a mirrored object, but with very different positions. The logical choice if we're talking about the z-axis would be to mirror z, but that will result in an object projecting into the ground in most cases. How do you justify choosing one axis to mirror over another? It seems rather confusing from a user's standpoint, or am I missing something obvious?

-Greg

···

From: "Lars O. Grobe" <[email protected]>
Date: May 14, 2004 6:49:10 AM PDT

Hi Carsten, hi list!

if you look into the mirror, you don't see yourself upside down, so I guess that formZ behaves correctly in leaving the normal unchanged during mirroring :slight_smile:

In fact, it was what I had guessed. However, I wanted to be sure. Also, I wonder if there is any reason why the surface normal information is not used from the triangle.

I think, if I replace the call to fcross() in replmarks.c by a routine that aligns the z-achsis to the surface normal, mirroring transformations should be supported by replmarks, right? Is there a function to get the direction of the surface normal defined that I could use (I am sure it is, I just don't know where :wink: ?

Such a feature in replmarks would be very useful for me, as I could use just the triangle markers I have and I would not have to search for mirrored objects in the whole model, which would certainly introduce errors as I am rather sure that I would miss some objects.

CU Lars.

Hi,

I think there might be some misunderstanding going on here..

-1) my joking comment about looking into the mirror is (sad but true ..) a bit oversimplified. Of course you always need to specify additional information, i.e., mirroring with respect to what, and although intuitively one always thinks of a plane, sometimes the 'inversion' (x,y,z) -> (-x,-y,-z) is also called a mirror operation,('mirroring with respect to the origin'). On inversion, the normal also gets turned around.

-2) I never used replmarks before, but if I get it right from the previous discussion, you set up a scene with triangles in CAD, convert this to Radiance format and then replace the triangles with, say, instances.

The information about orientation is completely contained in the triangles (as long as they are drawn according to the replmarks specs, i.e. three different side lengths, of which the second and third smallest stand for the local x and y axis. The mentioned cross product X (x) Y = Z then is in fact the surface normal of the triangle.

You can now make a simple sketch on paper, draw a triangle with sides parallel to the coordinate axes, and 'mirror' it with respect to the, say, yz plane. If you simply replace the vertices by their mirrored counterparts, you soon end up with an inverted normal, which is in fact not what you want.

Now I don't know how formZ stores surface normal information, maybe it is stored separately, allowing to override the above effect. And this information then gets lost in the conversion, so replmarks gets feeded the wrong triangle and thus transforms the instance equally wrong.

Maybe ... just a simple guess..

Anyway, I assume that the error already lies within the mirroring operation. You can check this by drawing a simple scene in CAD with two mirrored triangles and the look at the converted rad input file. (look at the ordering of the two sets of vertices in the polygon data)

-cb

Hi,

sorry, the problem is that formZ keeps the normal pointing up after mirroring when the original surface normal was in that direction. However, when I export the scene as dxf and re-import it, surface normals of both triangles point downwards.... bad luck, and no problem about radiance.

Lars.

···

--
Lars O. Grobe
[email protected]