Thanks TIG it is a good point
Latest posts made by krisjaniszakis
-
RE: Ruby array to hash
Thanks TIG your generous script prints out unique arrays and it is not realy the exact case.
thomthom -> name, value
h{"name" => value, "name" => value,}
Looks like I havn't told all the details.
- I have multidimensional
array[]
in Ruby - I want to send array[] to Webdialog using
dialog.execute_script()
- I want to send to PHP and arrange and do stuf with
array[]
My
array[]
looks like thisarray[[value1, value2, value3,...],[value1, value2,...],...]
Im trying to transform
array[]
tohash{}
hash{0=>[0_0=>value1,0_1=>value2,0_2=>value3,...],1=>[1_0=>value1,1_1=>value2,...],...}
maybe I don't need transform, maybe I can send directly from Ruby to PHP without sending to Webdialog ?
- I have multidimensional
-
Ruby array to hash
Hi is there a fast way or some ruby libraries how to convert array[] to hash{} ?
Example of array[]:
a=[] a << [test1, test2, test3, test4]
How can I fill in hash{} with entity name and value?
-
RE: Webdialog connect to PHP
Thanks GΓ‘bor and jiminy-billy-bob I combined both scripts and now understand how to do it
Does some one know how big(length) array ("v") I can send through ?
window.location='http://myserver.com/myfile.php?v=' + v;
-
RE: Webdialog connect to PHP
Thanks I thought about it too, but could you pleas post small code example ?
-
RE: Webdialog connect to PHP
It gives me blank page and doesn't transfer
data
array to that pageI will try to look at AJAX thanks.
-
Webdialog connect to PHP
Have some one tried to send data from Webdialog to PHP.
How to do it ?
I found that post_url could help but it doesnt.data << [aa,bb,11,22] dlg = UI::WebDialog.new dlg.post_url("http://localhost/sketch/index.php",data)
-
RE: Angle between north and face
Thanks it was the thing I was looking for
-
RE: Angle between north and face
@jolran said:
Hi!
No response ey? I give it a try.
Maybe this code is part of a larger piece, otherwise I have a little trouble following your logic.
Have never used shadow info, and do not have time to look up the methods revolving that.
Does it really return an angle?What is entity ? a face?
Unless you are going to use those variables later why not just enter:
tr = Geom::Transformation.rotation(ORIGIN, Z_AXIS, rotation)
Does not really matter for solving this problem though..Try putting a bang to it! Edit in place..
north_vector.transform! (tr)
I just wanted to automating angle between north and face.
With entity I meant "face".Here is updated code
` north_angle = Sketchup.active_model.shadow_info['NorthAngle']
flat_normal = entity.normal.clone
flat_normal.z = 0
north_vector = Y_AXIS.clone
north_vector.z = 0
point = ORIGIN
up = Z_AXIS
rotation = north_angle.degrees
tr = Geom::Transformation.rotation(point,up,rotation)
north_vector.transform! (tr)
angle = (north_vector.angle_between(flat_normal)).radiansif flat_normal.x < 0 angle = 360-angle else angle end`
And here is Sketchup screenshot with my experiment.
For this example script gives that angle between will be 100but not 50, where is the problem ?
-
RE: Angle between north and face
Can some one see:
- why if I change north angle result is not changing?
` north_angle = Sketchup.active_model.shadow_info['NorthAngle']
north_vector = Y_AXIS.clone
north_vector.z = 0
flat_normal = entity.normal.clone
flat_normal.z = 0
point = ORIGIN
up = Z_AXIS
rotation = north_angle.degrees
tr = Geom::Transformation.rotation(point,up,rotation)
north_vector.transform (tr)
angle = (flat_normal.angle_between(north_vector)).radiansif flat_normal.x < 0 angle = 360-angle else angle end`