1

I have a sliced shape that I would like to copy it's outline as it's seen from the top down view (looking straight down on it).

Example: I have an equation that is sliced by a plane using the Intersect option of the Boolean modifier.

img1

I then want to copy just the outline / Intersection (the "warped" egg shape circled in red) that is created when looking at it from the top down view.

img2

I was looking at the Knife project tool but I want the projection of top down view of a slice.

I feel like I'm over thinking it. I'm willing to try a different solution.

Rick T
  • 4,391
  • 1
  • 20
  • 64
  • 1
    As in copy the edge ring, separate, and shrinkwrap project in Z onto an XY plane or via code set the z coord of each ring vert to a constant.? – batFINGER Feb 28 '21 at 09:39
  • @batFINGER Yes to the first part project Z onto XY. Not sure what the 2nd "via code set the z cord to a constant" it sounds intriguing (not sure what that will do or how to do that). – Rick T Feb 28 '21 at 09:43
  • same as first. XY ground plane is Z=0 hence any coord on that plane is (x, y, 0) – batFINGER Feb 28 '21 at 09:45
  • @batFINGER sounds quicker. I duplicated the edge loop but how does one set each edge to zero so it mimics the "egg" shape? – Rick T Feb 28 '21 at 09:53
  • 1
    set the vert coords. 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
  • 1
    I don't get it. Shift-D copy, followed by SZ0? – Robin Betts Feb 28 '21 at 16:09
  • 1
    @RobinBetts I knew I was over thinking...At-least I learned new ways to do it. Thanks. – Rick T Feb 28 '21 at 17:00

1 Answers1

2

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?

batFINGER
  • 84,216
  • 10
  • 108
  • 233