2
$\begingroup$

I have been assigned the task of making a 3D model from a site plan for a big wind park in Germany. I have a plane (7km X, 8km Y) long. I want a point in the left corner of the plane as a point from where I can move my windmill models with co-ordinates. Like windmill_1 2km left and 1 km up. A windmill in the left corner of the plane will have the location settings a 0;0;0.

Is there any solution? Thanks in adavice.

$\endgroup$
  • $\begingroup$ could you make a drawing to visualize what you exactly mean? :) $\endgroup$ – Faceb Faceb Jun 18 '15 at 17:04
  • $\begingroup$ Sure! goo.gl/OUhyoK The settings for this cube should be 0. How could i do that? $\endgroup$ – CookieFresh Jun 18 '15 at 17:18
  • $\begingroup$ @zeffi I know, i mean is there a way to set it to 0 and that is in this position? $\endgroup$ – CookieFresh Jun 18 '15 at 17:37
  • $\begingroup$ @CookieFresh, if you have the object origin (0x, 0y, 0z) at a left corner, an object with co-ordinates 2 units to the left of the origin plane will be off of the site plan. $\endgroup$ – brasshat Jun 18 '15 at 17:44
  • $\begingroup$ @zeffi As i said..its hard to explain. But i will have your script use to! I need to lets say, spawn a windmill in the left conor. It need to have x= 0 y=0 z=0. So that i can then use the co-ordinates (in km's) to position the windmills 1:1 like in the site plan that i have. $\endgroup$ – CookieFresh Jun 18 '15 at 17:45
2
$\begingroup$

You can parent the windmills to an empty. That way the objects will have coordinates relative to the local coords of their parent.

  1. In edit mode, snap the 3D cursor to a vertex in the top-left corner of your plane
  2. Go back to object mode and add an empty
  3. Snap your windmill to the 3D cursor, so it's in the same position as the empty
  4. Parent the windmill to the empty
  5. Now you can change the location of the windmill relative to the corner
  6. You can add more windmills by duplicating
$\endgroup$
2
$\begingroup$

Do this via a script, if you have the X, Y, Z coordinates of the base of each windmill, you can iterate through the list of coordinates and place a windmill at each coordinate.

Let's say you make a windmill object, or a group..

import bpy
import mathutils 
from mathutils import Vector

scene = bpy.context.scene

# if you have a group named windmill
group = bpy.data.groups['windmill']

# all coordinates will be offset by this vector, your new 'origin'.
custom_origin = Vector((3, 4, 0.2))   

coordinates = [
    (18.2807, 9.1404, -1.2686),
    (27.4211, 9.1404, 0.9514),
    (9.1404, 9.1404, -1.11),
    (18.2807, 31.9913, 2.1671),
    (18.2807, 13.7106, 0.0),
    (18.2807, 22.8509, 1.3214),
    (27.4211, 13.7106, 2.96),
    (27.4211, 22.8509, 2.1143),
    (31.9913, 22.8509, 3.7),
    (22.8509, 22.8509, 1.3214),
    (13.7106, 22.8509, 0.0),
    (4.5702, 31.9913, 0.0),
    (22.8509, 13.7106, 2.96),
    (13.7106, 31.9913, 2.4843)
]

for loc in coordinates:
    instance = bpy.data.objects.new('dupli_group', None)
    instance.dupli_type = 'GROUP'
    instance.dupli_group = group
    scene.objects.link(instance)
    instance.location = Vector(loc) + custom_origin  # adds them.

enter image description here

$\endgroup$
  • $\begingroup$ Insane! But i think would prefer a non script method. Because i always suck with scripts. $\endgroup$ – CookieFresh Jun 18 '15 at 17:20
  • $\begingroup$ if you have more than 10 coordinates... use a script. $\endgroup$ – zeffii Jun 18 '15 at 17:26
  • $\begingroup$ I will try! thanks Have you a idea how i can set this cordinates to 0? goo.gl/OUhyoK $\endgroup$ – CookieFresh Jun 18 '15 at 17:29
  • $\begingroup$ @CookieFresh I added an alternative portion of script to deal with the offset from the True 0,0,0 , in the second version everything will be relative to the new custom origin. $\endgroup$ – zeffii Jun 18 '15 at 17:50
  • $\begingroup$ So i can use both scripts at the same time? And have i to configure at the alternative portion? $\endgroup$ – CookieFresh Jun 18 '15 at 18:01
1
$\begingroup$

Choose the left corner of the plane that you want to be the origin point (0,0,0), and select it. Now snap in edit mode, snap SHFT-A the cursor to selected. and set the origin CTRL-Shft-Alt-C to the 3D cursor. The origin point is now at the corner.

Another way is to go to edit mode, select all of the vertices, and move them so that the left corner is over the origin of the mesh.

In either case it would probably be wise to apply your locations with CTRL-A.

Now, to apply your windmills in the desired position, in the edit mode, properties shelf (exposed by pressing N under "3D cursor" enter the location for the new windmill in the spaces provided. When you go to object mode to add the new windmill object, it will be added at the 3D cursor.

$\endgroup$
  • $\begingroup$ Thanks! Is there a way to spawn a object in the left conor withco-ordinates that are 0? $\endgroup$ – CookieFresh Jun 18 '15 at 17:39

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.