Simple 3D Cube with a phase

Simple 3D Cube with a phase Free low-poly 3D model

Description

This Cube with a side relationship of 3.0 to 2.0 to 1.0 with a phase on one side of 0.1 can easily be used as a base to construct more complex models. I constructed it with a python script in blender therefore i'm able to construct easily all relationships needed. Here is the script:

import bpy

from bpy import data as D, context as C

import bmeshimport mathimport mathutilsfrom mathutils import Vectorfrom math import radians

variables

length = 3.0width = 2.0height = 1.0

bevel_angle = 30bevel_z = 0.1bevel_xy = bevel_z / math.tan(radians(bevel_angle))

vectors

vec_01 = mathutils.Vector((-length / 2, -width / 2, 0.0))vec_02 = mathutils.Vector((-length / 2, width / 2, 0.0))vec_03 = mathutils.Vector((length / 2, -width / 2, 0.0))vec_04 = mathutils.Vector((length / 2, width / 2, 0.0))

vec_05 = mathutils.Vector((-length / 2, -width / 2, height - bevel_z))vec_06 = mathutils.Vector((-length / 2, width / 2, height - bevel_z))vec_07 = mathutils.Vector((length / 2, -width / 2, height - bevel_z))vec_08 = mathutils.Vector((length / 2, width / 2, height - bevel_z))

vec_09 = mathutils.Vector((-length / 2 + bevel_xy, -width / 2 + bevel_xy, height))vec_10 = mathutils.Vector((-length / 2 + bevel_xy, width / 2 - bevel_xy, height))vec_11 = mathutils.Vector((length / 2 - bevel_xy, -width / 2 + bevel_xy, height))vec_12 = mathutils.Vector((length / 2 - bevel_xy, width / 2 - bevel_xy, height))

Make a new BMesh

bm = bmesh.new()

make vertexes

verts = [vec_01, vec_02, vec_03, vec_04, vec_05, vec_06, vec_07, vec_08, vec_09, vec_10, vec_11, vec_12]

create facesEach face is a tuple that contains the indicesthat point to elements in the array above. Ann-gon will only have one tuple, but for eachadditional face, add another tuple.

faces = [(0, 1, 3), (3, 2, 0), {0, 1, 5}, {5, 4, 0}, {2, 3, 7}, {7, 6, 2}, {0, 2, 6}, {6, 4, 0}, {1, 3, 7}, {7, 5, 1}, {4, 8, 6}, {8, 6, 10}, {5, 9, 7}, {9, 7, 11}, {4, 5, 8}, {5, 8, 9}, {6, 7, 10}, {7, 10, 11}, {8, 9, 11}, {11, 10, 8}]

If the faces list above is specified, thenthe edges list needs only to be an empty list,i.e. [] .

edges = []

Create mesh from above data.

mesh_name = modCubemesh_data = D.meshes.new(mesh_name)mesh_data.from_pydata(verts, edges, faces)

Returns True if any invalid geometry was removed.

corrections = mesh_data.validate( verbose=True, clean_customdata=True)

Load BMesh with mesh data.

bm = bmesh.new()bm.from_mesh(mesh_data)

bm.to_mesh(mesh_data)bm.free()mesh_obj = D.objects.new(mesh_data.name, mesh_data)C.collection.objects.link(mesh_obj)

make normals consistent

bpy.ops.object.select_all(action='DESELECT')mesh_obj.select_set(True)bpy.context.view_layer.objects.active = mesh_obj

go edit mode

bpy.ops.object.mode_set(mode='EDIT')

select al faces

bpy.ops.mesh.select_all(action='SELECT')

recalculate outside normals

bpy.ops.mesh.normals_make_consistent(inside=False)

go object mode again

bpy.ops.object.editmode_toggle()

Item rating
0 0
Simple 3D Cube with a phase
Free
 
Royalty Free No Ai License 
Simple 3D Cube with a phase
Free
 
Royalty Free No Ai License 
Response - % in - h

3D Model formats

Format limitations
  • Stereolithography (.stl)1.06 KB

3D Model details

  • Publish date2022-02-21
  • Model ID#3599020
  • Animated
  • Rigged
  • VR / AR / Low-poly
  • PBR
  • Geometry Polygon mesh
  • Polygons 0
  • Vertices 12
  • Textures
  • Materials
  • UV Mapping
  • Unwrapped UVs Unknown
  • Plugins used
  • Ready for 3D Printing
Chat