Hi,
I have a bad problem with obj2mesh... I used lots of obj's with obj2rad so far, and some in a more or less stupid way, converting them to meshes, writing a mesh primitive in a file, scaling it and making an instance of the file than. Now I would like to replace this stupid mesh-to-instance step, but I run into the problem that I cannot scale my obj with obj2mesh. Is there noone else needing such an option? Or is there a way to scale the object input? My problem is that I am using lots of files, scripted processing, and input my instances or meshes to replmarks. But I cannot make sure that all my markers have the x-axis 1 unit long (than I could use replmark's -s SCALE). I was thinking of writing my mesh primitive in a small file, apply xform to this and use it than with replmarks -x. Still, it seams to be a silly way to deal with the fact that my objs are in feet and my model in meter.
TIA+CU, Lars.
Hi Lars,
Although I agree it would be nice to have a facility for either transforming .OBJ files directly or as part of obj2mesh, there is a solution with replmarks you may not have thought about. Rather than creating your mesh instances directly with replmarks -I, instead create a single Radiance scene file for each mesh with the appropriate scale factor. E.g., if you had a mesh called filecab.rtm that needed to be rotated in x and scaled, you would also create a file called filecab.rad that contains:
void mesh filecab
5 filecab.rtm -rx 90 -s 0.3048
0
Then, you can use replmarks -x filecab.rad instead of -I, and replmarks will load this file and add the other rotation and translation arguments necessary to put the object in the right place.
Does this help?
-Greg
···
From: Lars O. Grobe <[email protected]>
Date: February 28, 2006 1:21:44 PM PST
Hi,
I have a bad problem with obj2mesh... I used lots of obj's with obj2rad so far, and some in a more or less stupid way, converting them to meshes, writing a mesh primitive in a file, scaling it and making an instance of the file than. Now I would like to replace this stupid mesh-to-instance step, but I run into the problem that I cannot scale my obj with obj2mesh. Is there noone else needing such an option? Or is there a way to scale the object input? My problem is that I am using lots of files, scripted processing, and input my instances or meshes to replmarks. But I cannot make sure that all my markers have the x-axis 1 unit long (than I could use replmark's -s SCALE). I was thinking of writing my mesh primitive in a small file, apply xform to this and use it than with replmarks -x. Still, it seams to be a silly way to deal with the fact that my objs are in feet and my model in meter.
TIA+CU, Lars.
Hi Lars,
It seems that you have the following possible options:
1. scale the obj file the way you want on export from what ever the
modeler is generating
2. you can add scaling and other transforms directly to the mesh
primitive, why not script this
3. can you figure out a way to guarantee that you get unit markers
(eg 1 unit long in x), we use unit markers all over the place and
do not have problems, perhaps this is a modeling/software issue?
4. you should be able to pipe things together so that you do not have
a bunch of intermediate files such as:
replmarks -I object.rtm origin origin.rad | xform -s <your
scale factor> > tmp.scale.rad
replmarks -x tmp.scale.rad new-location new-location.rad >
final.object.rad
This is not nearly as elegant as I had hoped. I cannot see how to construct one single pipeline. But nevertheless it may get the job done. You would need to construct a marker object called origin in origin.rad (a right triangle with x of 1). The first line gets you the scaling. The second line get you the transform of the scaled object to the desired location. The ordering here is to get the scaling to occur before the transform. Then tmp.scale.rad can be discarded by the script or just overwritten by subsequent calls for other object transforms.
-Jack
Lars O. Grobe wrote:
···
Hi,
I have a bad problem with obj2mesh... I used lots of obj's with obj2rad so far, and some in a more or less stupid way, converting them to meshes, writing a mesh primitive in a file, scaling it and making an instance of the file than. Now I would like to replace this stupid mesh-to-instance step, but I run into the problem that I cannot scale my obj with obj2mesh. Is there noone else needing such an option? Or is there a way to scale the object input? My problem is that I am using lots of files, scripted processing, and input my instances or meshes to replmarks. But I cannot make sure that all my markers have the x-axis 1 unit long (than I could use replmark's -s SCALE). I was thinking of writing my mesh primitive in a small file, apply xform to this and use it than with replmarks -x. Still, it seams to be a silly way to deal with the fact that my objs are in feet and my model in meter.
TIA+CU, Lars.
------------------------------------------------------------------------
_______________________________________________
Radiance-general mailing list
[email protected]
http://www.radiance-online.org/mailman/listinfo/radiance-general
--
# Jack de Valpine
# president
#
# visarc incorporated
# http://www.visarc.com
#
# channeling technology for superior design and construction
I was thinking of writing my mesh primitive in a small file, apply xform to this and use it than with replmarks -x.
This was basically what Greg proposed in clear text (the xform-arguments of the mesh primitive, I just somehow managed to describe it 100x more complicated ;-). Jack's ideas are all right, my problem is that I have existing files (many) and thus cannot change all markers. I also have files containing markers for some instances and references that come already scaled (as both obj2rad and dxf2rad provide a scale option), with mappings fitting to those. So I cannot pipe the output of replmarks. I will add a line to my script to write a small rad-file for each mesh, including the scale transformations, and use that one with replmarks -x than.
Thanks, CU and good night, Lars.