2023年10月4日水曜日

配布ファイル 20231005 遠近法モード 表示画面の大きさ

 












今日の書き出し設定 項目メモ帳 2023: 20231005   立方体と 光線 https://2023na2022.blogspot.com/2023/10/20231005.html



























https://mokuji000zionad.hatenablog.com/

配布ファイル 202301004  画像を blender のxy平面に貼る

 


blender python

今日の書き出し設定 項目メモ帳 2023: 20231004 選択したオブジェクトを回転させる https://2023na2022.blogspot.com/2023/10/20231004.html?spref=tw





G    Grab で 選択画像 移動

alt +G で 画像がセンターに移動








「配布 20231004 3軸 の 回転 001.blend」を共有







「配布 20231004 光時計 路面電車 001.blend」を共有





https://www.youtube.com/watch?v=6JjlXloUvAo




Dürer & 測距儀2022d054の2 王が決める時間 bbb 枠内を動く点と 2重枠内を動く点

https://togetter.com/li/2235505























https://mokuji000zionad.hatenablog.com/

2023年8月6日日曜日

 






import bpy


import math




# 小数の桁数を指定


decimal_places = 1




def create_plane_at_position(position, width, height, name, x, y, z):


    # 平面を作成(指定した座標に)


    bpy.ops.mesh.primitive_plane_add(size=1, location=position)


    plane = bpy.context.active_object




    # 幅と高さを設定


    plane.scale = (width, height, 1)




    # マテリアルを作成


    material = bpy.data.materials.new(name="Material_" + name)


    plane.data.materials.append(material)




    # マテリアルの設定


    material.use_nodes = False


    material.diffuse_color = (0.0, 1.0, 0.0, 1.0)  # 緑色 (R:0.0, G:1.0, B:0.0, A:1.0)




    # オブジェクトの名前を設定


    formatted_name = "{} ({:.{}f}, {:.{}f}, {:.{}f})".format(name, x, decimal_places, y, decimal_places, z, decimal_places)


    plane.name = formatted_name




def create_cone_or_circle_at_position(position, radius, height, name, x, y, z):


    if position == (0, 0, 0):


        # (0, 0, 0) の場合は円を作成


        bpy.ops.mesh.primitive_circle_add(radius=radius, location=position)


        obj = bpy.context.active_object


    else:


        # それ以外の場合は円錐を作成


        bpy.ops.mesh.primitive_cone_add(vertices=32, radius1=radius, radius2=0, depth=height, location=position)


        obj = bpy.context.active_object




        # 円錐の底面中心を (0, 0, 0) から遠ざける向きを計算


        direction = math.atan2(position[1], position[0])


        distance = math.sqrt(position[0]**2 + position[1]**2 + position[2]**2)


        angle = math.acos(position[2] / distance)


        obj.rotation_euler = (angle + math.pi, 0, direction + math.pi / 2)  # Y軸回りに90度回転




    # マテリアルを作成


    material = bpy.data.materials.new(name="Material_" + name)


    obj.data.materials.append(material)




    # マテリアルの設定


    material.use_nodes = False


    material.diffuse_color = (1.0, 0.0, 0.0, 1.0)  # 赤色 (R:1.0, G:0.0, B:0.0, A:1.0)




    # オブジェクトの名前を設定


    formatted_name = "{} ({:.{}f}, {:.{}f}, {:.{}f})".format(name, x, decimal_places, y, decimal_places, z, decimal_places)


    obj.name = formatted_name




# 正方形の面と円錐または円を作成


size = 0.3  # 正方形の一辺の長さ


spacing = 1.0  # 1間隔の大きさ




for i in range(-5, 6):  # -5から5までの座標に作成


    x = i * spacing


    y = 0


    z = 0




    position = (x, y, z)


    plane_name = "地図位置"


    obj_name = "事象情報"


    


    create_plane_at_position(position, size, size, plane_name, x, y, z)


    create_cone_or_circle_at_position(position, math.sqrt(2) * size / 2, size / 2, obj_name, x, y, z)





















https://mokuji000zionad.hatenablog.com/

2023年8月4日金曜日

20230804 bbb 球体追加の 現在時点の ミンコフスキー時空型

 







import bpy

import mathutils

import math


# 円周の中心座標

center_x = 0

center_y = 0

center_z = 0


# 円周の半径

radius = 6

# 円周に配置する円錐の数

num_cones = 12


# 円錐の底面が遠くなる位置を定義(例えば、X=2, Y=2, Z=2の場合)

target_x = 0

target_y = 0

target_z = 6


# 円周上の点を計算する

theta_values = [2 * math.pi * i / num_cones for i in range(num_cones)]

circle_points = [(center_x + radius * math.cos(theta), center_y + radius * math.sin(theta), center_z) for theta in theta_values]


# 円錐を配置する関数

def place_cone(position, direction):

    bpy.ops.mesh.primitive_cone_add(vertices=32, radius1=0.2, depth=24, location=position)

    cone = bpy.context.active_object

    bpy.context.view_layer.objects.active = cone


    # 向きを設定

    cone.rotation_euler = direction


# トーラスを描く関数

def draw_torus():

    bpy.ops.mesh.primitive_torus_add(location=(center_x, center_y, center_z), align='WORLD', major_radius=radius+0.0, minor_radius=0.1)


# 球体を追加する関数

def add_sphere(position, radius):

    bpy.ops.mesh.primitive_uv_sphere_add(radius=radius, location=position)


# 円錐を配置

for point in circle_points:

    # (0, 0, 0)への方向を計算

    target_vector = mathutils.Vector((target_x - point[0], target_y - point[1], target_z - point[2]))

    direction_rotation = target_vector.to_track_quat('Z', 'Y').to_euler()


    # 円錐の配置

    place_cone(point, direction_rotation)


# トーラスの描画

draw_torus()


# 球体の追加

add_sphere((target_x, target_y, target_z), 0.3)




















https://mokuji000zionad.hatenablog.com/

20230804 窓面円周 通過の円錐 矢印 ミンコフスキー型

 







import bpy
import mathutils
import math

# 円周の中心座標
center_x = 0
center_y = 0
center_z = 0

# 円周の半径
radius = 3

# 円周に配置する円錐の数
num_cones = 12

# 円錐の底面が遠くなる位置を定義(例えば、X=2, Y=2, Z=2の場合)
target_x = 0
target_y = 0
target_z = 0

# 円周上の点を計算する
theta_values = [2 * math.pi * i / num_cones for i in range(num_cones)]
circle_points = [(center_x + radius * math.cos(theta), center_y + radius * math.sin(theta), center_z) for theta in theta_values]

# 円錐を配置する関数
def place_cone(position, direction):
    bpy.ops.mesh.primitive_cone_add(vertices=32, radius1=0.2, depth=3, location=position)
    cone = bpy.context.active_object
    bpy.context.view_layer.objects.active = cone

    # 向きを設定
    cone.rotation_euler = direction

# トーラスを描く関数
def draw_torus():
    bpy.ops.mesh.primitive_torus_add(location=(center_x, center_y, center_z), align='WORLD', major_radius=radius+0.0, minor_radius=0.1)

# 円錐を配置
for point in circle_points:
    # (0, 0, 0)への方向を計算
    target_vector = mathutils.Vector((target_x - point[0], target_y - point[1], target_z - point[2]))
    direction_rotation = target_vector.to_track_quat('Z', 'Y').to_euler()

    # 円錐の配置
    place_cone(point, direction_rotation)

# トーラスの描画
draw_torus()















import bpy
import mathutils
import math

# 円周の中心座標
center_x = 0
center_y = 0
center_z = 0

# 円周の半径
radius = 3

# 円周に配置する円錐の数
num_cones = 12

# 円錐の底面が遠くなる位置を定義(例えば、X=2, Y=2, Z=2の場合)
target_x = 0
target_y = 0
target_z = 3

# 円周上の点を計算する
theta_values = [2 * math.pi * i / num_cones for i in range(num_cones)]
circle_points = [(center_x + radius * math.cos(theta), center_y + radius * math.sin(theta), center_z) for theta in theta_values]

# 円錐を配置する関数
def place_cone(position, direction):
    bpy.ops.mesh.primitive_cone_add(vertices=32, radius1=0.2, depth=3, location=position)
    cone = bpy.context.active_object
    bpy.context.view_layer.objects.active = cone

    # 向きを設定
    cone.rotation_euler = direction

# トーラスを描く関数
def draw_torus():
    bpy.ops.mesh.primitive_torus_add(location=(center_x, center_y, center_z), align='WORLD', major_radius=radius+0.0, minor_radius=0.1)

# 円錐を配置
for point in circle_points:
    # (0, 0, 0)への方向を計算
    target_vector = mathutils.Vector((target_x - point[0], target_y - point[1], target_z - point[2]))
    direction_rotation = target_vector.to_track_quat('Z', 'Y').to_euler()

    # 円錐の配置
    place_cone(point, direction_rotation)

# トーラスの描画
draw_torus()










https://mokuji000zionad.hatenablog.com/

20230804 窓面円周を貫く 円錐群

 








import bpy
import mathutils
import math

# 円周の中心座標
center_x = 0
center_y = 0
center_z = 0

# 円周の半径
radius = 3

# 円周に配置する円錐の数
num_cones = 12

# 円錐の底面が遠くなる位置を定義(例えば、X=2, Y=2, Z=2の場合)
target_x = 0
target_y = 0
target_z = 4

# 円周上の点を計算する
theta_values = [2 * math.pi * i / num_cones for i in range(num_cones)]
circle_points = [(center_x + radius * math.cos(theta), center_y + radius * math.sin(theta), center_z) for theta in theta_values]

# 円錐を配置する関数
def place_cone(position, direction):
    bpy.ops.mesh.primitive_cone_add(vertices=32, radius1=0.2, depth=3, location=position)
    cone = bpy.context.active_object
    bpy.context.view_layer.objects.active = cone

    # 向きを設定
    cone.rotation_euler = direction

# トーラスを描く関数
def draw_torus():
    bpy.ops.mesh.primitive_torus_add(location=(center_x, center_y, center_z), align='WORLD', major_radius=radius+0.0, minor_radius=0.1)

# 円錐を配置
for point in circle_points:
    # (0, 0, 0)への方向を計算
    target_vector = mathutils.Vector((target_x - point[0], target_y - point[1], target_z - point[2]))
    direction_rotation = target_vector.to_track_quat('Z', 'Y').to_euler()

    # 円錐の配置
    place_cone(point, direction_rotation)

# トーラスの描画
draw_torus()





















https://mokuji000zionad.hatenablog.com/

2023年7月28日金曜日

ChatGPT python で 3D ViewPort 背景色の変更方法

 





blender dark から 変更した 色付け



これが 元の blender dark 環境設定の色

2023年7月27日木曜日

ボンネットバス

 

20151214











20151208














リンクからの 画像

https://min.togetter.com/gPccjnb?page=2


























電光掲示板 20151110

 































HDRI Haven と 背景回転

 




HDRI(High Dynamic Range Image)は

HDRの画像で、多くの明るさ情報を持っている


高品質なHDR画像を無料でダウンロードできる

「HDRI Haven」【CC0, 商用利用可】 -

eizo.help https://eizo-help.hateblo.jp/entry/2019/07/12/114411





https://youtu.be/EVMbcXb9b6s?t=486


8:00/11:39 あたりから

Shader Editor
Object → World
Ctrl + T    Mapping  





blender youtbe 20230422 背景写真360度 回転 -

blenderzionadのブログ https://blenderzionad.hatenablog.com/entry/2023/04/22/125628







https://polyhaven.com/hdris


https://polyhaven.com/a/limpopo_golf_course


https://polyhaven.com/a/sunset_fairway






https://polyhaven.com/a/kloofendal_48d_partly_cloudy_puresky



























隠れた xyz軸 用 球体

 


























テンプレート

 





















2023年7月26日水曜日

平面を貼る

 







import bpy


# Parameters for the square

size = 10

y_pos = 10


# Create the square

vertices = [

    (-size/2, y_pos, -size/2),

    (-size/2, y_pos, size/2),

    (size/2, y_pos, size/2),

    (size/2, y_pos, -size/2)

]

faces = [(0, 1, 2, 3)]


# Create the mesh

mesh = bpy.data.meshes.new(name="SquareMesh")

mesh.from_pydata(vertices, [], faces)


# Create the object and link it to the scene

obj = bpy.data.objects.new("Square", mesh)

bpy.context.scene.collection.objects.link(obj)










import bpy


# Parameters for the square

size = 10

y_pos = 5


# Create the square

vertices = [

    (-size/2, y_pos, -size/2),

    (-size/2, y_pos, size/2),

    (size/2, y_pos, size/2),

    (size/2, y_pos, -size/2)

]

faces = [(0, 1, 2, 3)]


# Create the mesh

mesh = bpy.data.meshes.new(name="SquareMesh")

mesh.from_pydata(vertices, [], faces)


# Create the object and link it to the scene

obj = bpy.data.objects.new("Square", mesh)

bpy.context.scene.collection.objects.link(obj)






[Blender]オブジェクトに画像テクスチャを貼り付ける方法(画像あり)

https://civetta-blog.com/2023/02/10/blender%E3%82%AA%E3%83%96%E3%82%B8%E3%82%A7%E3%82%AF%E3%83%88%E3%81%AB%E7%94%BB%E5%83%8F%E3%83%86%E3%82%AF%E3%82%B9%E3%83%81%E3%83%A3%E3%82%92%E8%B2%BC%E3%82%8A%E4%BB%98%E3%81%91%E3%82%8B%E6%96%B9/



1



2 UV to Vector









3

Vector  to  Vector





【Blender】テクスチャの貼り方をしっかりとマスターしよう!

https://original-game.com/blender-how-to-apply-a-texture/











【blender 初心者】画像テクスチャを貼り付けて葉っぱを作る

https://www.youtube.com/watch?v=5BFo_GtmIGU




ああ



2023年7月25日火曜日

カメラ位置 000へ 移動

 







import bpy


# Get the camera object

camera = bpy.data.objects.get("Camera")


# If the camera exists, set its location to (0, 0, 0)

if camera:

    camera.location = (0, 0, 0)


































This script will find the camera object in the scene (assuming it is named "Camera") and set its location to (0, 0, 0). If there is a camera in the scene, it will be moved to the specified position.











My train car

aaa




 









aaaaaaaaaaaa



Assumed Plane の 球体群

 

Assumed Plane の 球体群









blender python


Y=0 の平面に

球体を作る

球体半径 0.1


x=-5から+5

Z=-5から+5の

交点に 作る






# Y=0 平面の 同時性


import bpy


# Parameters for the spheres

radius = 0.1

x_min = -5

x_max = 5

z_min = -5

z_max = 5


# Create spheres at the intersection points

for x in range(x_min, x_max + 1):

    for z in range(z_min, z_max + 1):

        bpy.ops.mesh.primitive_uv_sphere_add(radius=radius, location=(x, 0, z))







# Y=1 平面の 同時性


import bpy


# Parameters for the spheres

radius = 0.1

x_min = -5

x_max = 5

z_min = -5

z_max = 5


# Create spheres at the intersection points

for x in range(x_min, x_max + 1):

    for z in range(z_min, z_max + 1):

        bpy.ops.mesh.primitive_uv_sphere_add(radius=radius, location=(x, 1, z))







# Y=5 平面の 同時性


import bpy


# Parameters for the spheres

radius = 0.1

x_min = -5

x_max = 5

z_min = -5

z_max = 5


# Create spheres at the intersection points

for x in range(x_min, x_max + 1):

    for z in range(z_min, z_max + 1):

        bpy.ops.mesh.primitive_uv_sphere_add(radius=radius, location=(x, 5, z))








# Y=root 3 平面の 同時性


import bpy


# Parameters for the spheres

radius = 0.1

x_min = -5

x_max = 5

z_min = -5

z_max = 5


# Create spheres at the intersection points

for x in range(x_min, x_max + 1):

    for z in range(z_min, z_max + 1):

        bpy.ops.mesh.primitive_uv_sphere_add(radius=radius, location=(x, 3 ** 0.5, z))







# Y=2 平面の 同時性


import bpy


# Parameters for the spheres

radius = 0.1

x_min = -5

x_max = 5

z_min = -5

z_max = 5


# Create spheres at the intersection points

for x in range(x_min, x_max + 1):

    for z in range(z_min, z_max + 1):

        bpy.ops.mesh.primitive_uv_sphere_add(radius=radius, location=(x, 2, z))







# Y=5 平面の 同時性


import bpy


# Parameters for the spheres

radius = 0.1

x_min = -5

x_max = 5

z_min = -5

z_max = 5


# Create spheres at the intersection points

for x in range(x_min, x_max + 1):

    for z in range(z_min, z_max + 1):

        bpy.ops.mesh.primitive_uv_sphere_add(radius=radius, location=(x, 10, z))













# Assumed Plane
import bpy

# List of collection names
collection_names = [
    "Assumed Plane",
    "ap Y=0 Assumed Plane",
    "ap Y=1 Assumed Plane",
    "ap Y=root3 Assumed Plane",
    "ap Y=2 Assumed Plane",
    "ap Y=5 Assumed Plane",
    "ap Y=10 Assumed Plane"
]

# Function to create a new collection
def create_collection(name):
    collection = bpy.data.collections.new(name)
    bpy.context.scene.collection.children.link(collection)
    return collection

# Create collections
for name in collection_names:
    create_collection(name)
















# Assumed Plane
import bpy

# List of collection names
collection_names = [
    "Assumed Plane",
    "ap Y=0 Assumed Plane",
    "ap Y=1 Assumed Plane",
    "ap Y=root3 Assumed Plane",
    "ap Y=2 Assumed Plane",
    "ap Y=5 Assumed Plane",
    "ap Y=10 Assumed Plane"
]

# Function to create a new collection
def create_collection(name):
    collection = bpy.data.collections.new(name)
    bpy.context.scene.collection.children.link(collection)
    return collection

# Create collections
for name in collection_names:
    create_collection(name)

















あ


コレクションを作る

 


https://2023na2022.blogspot.com/2023/07/20230724-railcar.html




# コレクションを作る 重複の場合 作らない

import bpy


# List of collection names

collection_names = [

    "単位円 torus",

    "xyz 軸 円柱"

]


# Function to create a new collection if it doesn't exist

def create_collection_if_not_exists(name):

    if name not in bpy.data.collections:

        collection = bpy.data.collections.new(name)

        bpy.context.scene.collection.children.link(collection)


# Create collections

for name in collection_names:

    create_collection_if_not_exists(name)









# Assumed Plane
import bpy

# List of collection names
collection_names = [
    "Assumed Plane",
    "ap Y=0 Assumed Plane",
    "ap Y=1 Assumed Plane",
    "ap Y=root3 Assumed Plane",
    "ap Y=2 Assumed Plane",
    "ap Y=5 Assumed Plane",
    "ap Y=10 Assumed Plane"
]

# Function to create a new collection
def create_collection(name):
    collection = bpy.data.collections.new(name)
    bpy.context.scene.collection.children.link(collection)
    return collection

# Create collections
for name in collection_names:
    create_collection(name)










# My train car

import bpy

# List of collection names
collection_names = [
    "My train car",
    "mtc 0.8 size",
    "mtc 0.1 size"
]

# Function to create a new collection
def create_collection(name):
    collection = bpy.data.collections.new(name)
    bpy.context.scene.collection.children.link(collection)
    return collection

# Create collections
for name in collection_names:
    create_collection(name)





 




# My train car

import bpy

# List of collection names
collection_names = [
    "My train car",
    "mtc 0.1 size",
    "mtc 0.18 size"
]

# Function to create a new collection
def create_collection(name):
    collection = bpy.data.collections.new(name)
    bpy.context.scene.collection.children.link(collection)
    return collection

# Create collections
for name in collection_names:
    create_collection(name)










import bpy

# List of collection names
collection_names = [
   
 "My upper", 
"My upper",
"5", 
"√3", 
"1", 
"球体中心", 
"観察者"

]

# Function to create a new collection
def create_collection(name):
    collection = bpy.data.collections.new(name)
    bpy.context.scene.collection.children.link(collection)
    return collection

# Create collections
for name in collection_names:
    create_collection(name)





"想定平面"は英語で "Reference Plane" もしくは "Assumed Plane"

 




想定平面 英語に訳して

ChatGPT

"想定平面"は英語で "Reference Plane" もしくは "Assumed Plane" と訳されます。これは特定の計算や設計の際に、基準となる平面を指す用語です。この平面は仮定されるか、あるいは既知の平面であることが一般的です。


例えば、建築設計においては、想定平面は建物の基準となる平面を意味することがあります。また、数学や物理学においても、特定の計算や解析における基準として想定される平面を指す場合があります。


したがって、文脈によって適切な意味を持つ用語として "Reference Plane" もしくは "Assumed Plane" を使用することができます。





想定平面 英語に訳して

ChatGPT

"想定平面"を英語に訳すと、"reference plane" もしくは "datum plane" となります。



datum

https://www.google.com/search?q=datum&rlz=1C1TKQJ_jaJP1038JP1038&sourceid=chrome&ie=UTF-8






DataとDatumの違いは何ですか?

dataは必ずしも英語でまだ元の意味を保っている「datum」(ラテン語の「与えられたもの」を意味する)の複数形ではありません。 「datum」は地図製作や地理学の分野で使用され、基準点や基準線、基準面を意味します。 「data」が「datum」の複数形でないのであれば「are」を使う必要はなくなります。

https://www.ytrans.com/aspect-of-language/26-data-isdata-are#:~:text=data%E3%81%AF%E5%BF%85%E3%81%9A%E3%81%97%E3%82%82%E8%8B%B1%E8%AA%9E%E3%81%A7,%E4%BD%BF%E3%81%86%E5%BF%85%E8%A6%81%E3%81%AF%E3%81%AA%E3%81%8F%E3%81%AA%E3%82%8A%E3%81%BE%E3%81%99%E3%80%82




datum plane

https://www.google.com/search?rlz=1C1TKQJ_jaJP1038JP1038&sxsrf=AB5stBgNPPoAxwbpmmMcY3tslmLwijq84w:1690347961642&q=datum+plane&tbm=isch&source=lnms&sa=X&ved=2ahUKEwjHq7PuzKuAAxWFCd4KHX9RBkYQ0pQJegQIChAB&biw=1280&bih=648&dpr=1.5




https://www.researchgate.net/figure/Datum-planes-of-human-body_fig3_343245147











あああ




配布ファイル 20231005 遠近法モード 表示画面の大きさ

  今日の書き出し設定 項目メモ帳 2023: 20231005   立方体と 光線 https://2023na2022.blogspot.com/2023/10/20231005.html https://mokuji000zionad.hatenablog.com/