construction plane from current view?

construction plane from current view?

graynak
Participant Participant
1,347 Views
9 Replies
Message 1 of 10

construction plane from current view?

graynak
Participant
Participant

is there a way to generate a construction plane based on the current view within the viewport?

a simple example is that we scan tubular vehicle chassis for retrofitting parts

i can manipulate the view to a position that 'feels' orthogonal to the tube-section at a particular area ... 

i then want to create a sketch at that one exact view for brackets or collars

 

i know i can name that particular view ... but i can't then go in and create a plane from it

 

i think i can do some of that manipulation in mesh-mode with points on three-planes ... but that requires not capturing history ... which destroys all previous work.

 

thanks!

 

 

 

0 Likes
1,348 Views
9 Replies
Replies (9)
Message 2 of 10

g-andresen
Consultant
Consultant

Hi,

Please share an appropriate file with a hint where the layer should be located.

 

File > export > save as f3d on local drive  > attach it to the next post.

 

günther

0 Likes
Message 3 of 10

jeff_strater
Community Manager
Community Manager

"is there a way to generate a construction plane based on the current view within the viewport?"

 

No, there is no way to do that.  There should not be any view-dependent operations in a parametric design.  Viewing operations are considered to be graphics-only operations, and do not affect the creation of geometry or features


Jeff Strater
Engineering Director
0 Likes
Message 4 of 10

graynak
Participant
Participant

Thanks Jeff S.

I appreciate that rigor in full parametric design.

I am often straddling the parametric universe and the cold hard steel of less-than-perfect real-life fabrication.

It would be nice to cheat every now and then with the feature described above.

I remember having it in Rhino when I was using that a hundred years ago.

 

Anyway .. my current method starts at the very beginning with a raw mesh and actually setting real orthogonal planes in the mesh.

The issue is that going back into that raw mesh ... and making adjustments using 'a plane from three points'  requires destroying the files history.

 

thanks anyway ... 

i'll continue to use the intersecting-planes-to-create-an-axis method

geoff

 

0 Likes
Message 5 of 10

g-andresen
Consultant
Consultant

Hi,

I would just like to note that possible solutions will not be given as long as an exemplary sample file for analysis is missing.

 

günther

0 Likes
Message 6 of 10

graynak
Participant
Participant

Thanks Gunther

Unfortunately ... the files are 100+ MB ... since the meshes are big ... 
but here are a few screen grabs to give the idea: 

 

as i zoom into a cross section of the lower chassis tube of this scan ...

i can position my view in a way that i can 'guess' at what would be the most orthogonal view to the tube

then ... if i could put a plane on that view ...  i could then make a three-point circle and reverse-engineer the chassis tubing

 

thanks

 

 

 

Screenshot 2022-07-20 141204.jpg

Screenshot 2022-07-20 141225.jpg

Screenshot 2022-07-20 141306.jpg

Screenshot 2022-07-20 141354.jpg

0 Likes
Message 7 of 10

pavel_viktorin
Contributor
Contributor

Hi, I've written a script that, after selecting a point on the model, creates a construction plane at that point, oriented according to the viewport.


Here's how it works:

 

  • You must be in the design environment
  • Run the script
  • Select the point
  • Construction plane is created

 

import adsk.core, adsk.fusion, traceback

def run(context):
    app = adsk.core.Application.get()
    ui = app.userInterface
    design = adsk.fusion.Design.cast(app.activeProduct)
    view = app.activeViewport

    
    def center_view_on_point(point):
        cam = view.camera

        offset = adsk.core.Vector3D.create(
            point.x - cam.target.x,
            point.y - cam.target.y,
            point.z - cam.target.z
        )

        new_eye = cam.eye.copy()
        new_eye.translateBy(offset)
        new_target = cam.target.copy()
        new_target.translateBy(offset)

        cam.eye = new_eye
        cam.target = new_target
        cam.isFitView = False
        view.camera = cam
        view.refresh()

    def create_plane():
        rootComp = design.rootComponent
        camera = app.activeViewport.camera
        cam_eye = camera.eye
        sketches = rootComp.sketches
        sketch3D = sketches.add(rootComp.xYConstructionPlane)
        sketchLines = sketch3D.sketchCurves.sketchLines

        vector = adsk.core.Vector3D.create(
                    cam_eye.x - point_of_interest.x,
                    cam_eye.y - point_of_interest.y,
                    cam_eye.z - point_of_interest.z
                )
        vector.normalize()

        # construction plane scale
        scale_factor = 10.0
        vector.scaleBy(scale_factor)

        transformed_point = adsk.core.Point3D.create(
            point_of_interest.x + vector.x,
            point_of_interest.y + vector.y,
            point_of_interest.z + vector.z
        )

        line = sketchLines.addByTwoPoints(transformed_point, point_of_interest)

        planes = rootComp.constructionPlanes
        planeInput = planes.createInput()
        distance = adsk.core.ValueInput.createByReal(1)
        planeInput.setByDistanceOnPath(line, distance)
        construction_plane = planes.add(planeInput)
        construction_plane.name = "Plane from view"
        sketch3D.name = "plane sketch"
        sketch3D.isVisible = False

    if not design:
        ui.messageBox('You need to be in the design workspace')
        return

    ui.messageBox('Select a point on the model.')

    selection = ui.selectEntity('Select a point on the model.', 'Vertices,ConstructionPoints')
    if not selection:
        ui.messageBox('No point was selected.')
        return

    selected_point = selection.entity.geometry
    point_of_interest = adsk.core.Point3D.create(selected_point.x, selected_point.y, selected_point.z)
    center_view_on_point(point_of_interest)
    create_plane()

 

Message 8 of 10

elrico_cattaneo
Community Visitor
Community Visitor

You beautiful person, I can not believe you have come back in here 3 years later to solve this. This works brilliantly thank you so, so much. 

Message 9 of 10

HughesTooling
Consultant
Consultant

@graynak wrote:

 

i think i can do some of that manipulation in mesh-mode with points on three-planes ... but that requires not capturing history ... which destroys all previous work.

 

thanks!

 


Just in case it's helpful to someone you can create a three point plane in direct edit mode without losing history.

HughesTooling_0-1758708645458.png

HughesTooling_1-1758708733258.png

 

 

Mark Hughes
Owner, Hughes Tooling
Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.

EESignature


0 Likes
Message 10 of 10

Mr_8hz
Explorer
Explorer

Hi 
How to add that script text? 

Thanks!

0 Likes