Via a script.
A "conic section script".
Define a plane via its global location and normal. For example add a plane named "Plane" aligned to cut
>>> C.object
bpy.data.objects['Plane']
plane_co Global coordinate.
>>> C.object.matrix_world.translation
Vector((0.0, 0.0, 0.0))
plane_no Global normal. (its rotation x z axis)
>>> C.object.matrix_world.to_3x3() @ Vector((0, 0, 1))
Vector((0.8242384195327759, -0.06781885027885437, 0.5621669292449951))
Running this script will bisect the context object (with modifiers and shapekeys applied) using the plane coordinates supplied and create a new segment object.
import bpy
import bmesh
from mathutils import Matrix
from bpy import context
cutting plane coords and normal (global)
plane_co = (0, 0, 0)
plane_no = (1, 1, 1)
project_to_ground = True
ob = context.object
object with modifiers shapekeys applied.
bm = bmesh.new()
bm.from_object(
ob,
context.evaluated_depsgraph_get()
)
bm.transform(ob.matrix_world)
bmesh.ops.bisect_plane(
bm,
geom=sum((bm.verts[:], bm.edges[:], bm.faces[:]), []),
plane_no=plane_no,
plane_co=plane_co,
clear_inner=True,
clear_outer=True,
)
me = bpy.data.meshes.new(f"{ob.name}_Section")
bm.to_mesh(me)
if project_to_ground:
me.transform(Matrix.Scale(0, 4, (0, 0, 1)))
new_ob = bpy.data.objects.new(f"{ob.data.name}_Section", me)
context.collection.objects.link(new_ob)
Related
Planetary system simulation with real orbital datas
How to extract side-view outline (e.g. top view) of a 3D object to 2D surface?
for v in youredgeloopobject.data.vertices: v.co.z = 0(This assumes that the mesh has no loc rot & unit scale, ie local and global coords same) Somewhat related https://blender.stackexchange.com/questions/132925/planetary-system-simulation-with-real-orbital-datas – batFINGER Feb 28 '21 at 09:56