Welcome to the Onshape forum! Ask questions and join in the discussions about everything Onshape.

First time visiting? Here are some places to start:
  1. Looking for a certain topic? Check out the categories filter or use Search (upper right).
  2. Need support? Ask a question to our Community Support category.
  3. Please submit support tickets for bugs but you can request improvements in the Product Feedback category.
  4. Be respectful, on topic and if you see a problem, Flag it.

If you would like to contact our Community Manager personally, feel free to send a private message or an email.

3D point

alberto_porrasalberto_porras Member Posts: 2 EDU
Hi,
I would like to know if it's possible to create a 3D point by coordinates. 
Sometimes it is useful to create geometry from a specific point, thus I need a 3D point.
Thanks a lot in advance
«1

Answers

  • mahirmahir Member, Developers Posts: 1,291 ✭✭✭✭✭
    Manually, you would need to create a plane that intersects either the X, Y, or Z coordinate of the desired point. Then you can place a sketch point on that plane and dimension it accordingly.

    The more direct path would be to use featurescript. Here's an example script by @dave_cowden. It requires at least 2 points to be created, but it could be edited to allow an individual point.
    https://cad.onshape.com/documents/502108ab33bd9af500b73c1a/w/68f73347f084d40c31271b24/e/5c9b644bfa74fd744d6bf626
  • paul_chastellpaul_chastell Onshape Employees Posts: 124
    edited May 2018
    Or, also with a custom feature, you could make a single point with one operation call, to opPoint, which takes (x,y,z) coordinates and make a point there.

    https://cad.onshape.com/documents/05e61f73d88c30ebe9e3baf8/w/6e72e2b08afb63489da10bdf/e/a7fc29bda73abe3a05aec06b

    annotation { "Feature Type Name" : "3D Point" }
    export const threePoint = defineFeature(function(context is Context, id is Id, definition is map)
        precondition
        {
            annotation { "Name" : "X" }
            isLength(definition.x, LENGTH_BOUNDS);
            annotation { "Name" : "Y" }
            isLength(definition.y, LENGTH_BOUNDS);
            annotation { "Name" : "Z" }
            isLength(definition.z, LENGTH_BOUNDS);        
        }
        {
            opPoint(context, id + "point", {
                    "point" : vector(definition.x, definition.y, definition.z)
            });
        });

    Paul Chastell
    TVP, Onshape R&D
  • mahirmahir Member, Developers Posts: 1,291 ✭✭✭✭✭
    I'm surprised there isn't a general point FS out there that let's you create points from various inputs. Maybe my next project :)
  • mahirmahir Member, Developers Posts: 1,291 ✭✭✭✭✭
    edited May 2018
    I think I'll take a crack at a flexible point FS this week. Here are the input options that I can think of. Can anyone think of any others that would be useful?
    • Intersection - intersects all queried geometries to get a point (e.g. 3 planes/surfaces, plane/surface & line, 2 planar lines)
    • Projection - normal projection of point onto a plane/surface
    • Along Curve - point located X% from either endpoint of a curve/edge
    • XYZ - point located via coordinates
  • konstantin_shiriazdanovkonstantin_shiriazdanov Member Posts: 1,221 ✭✭✭✭✭
    edited May 2018
    mahir said:
    • Along Curve - point located X% from either endpoint of a curve/edge
    @mahir
    I would propose this option to work with multy-edge paths as well.
    UPD: and possibly when you will work on Intersection option you can make a subfeature which would create intersection wire body from sets of faces, which is also often needed
  • mahirmahir Member, Developers Posts: 1,291 ✭✭✭✭✭
    @mahir
    I would propose this option to work with multy-edge paths as well.
    UPD: and possibly when you will work on Intersection option you can make a subfeature which would create intersection wire body from sets of faces, which is also often needed
    Shouldn't be a problem. For multiple edges I'll just have to create a composite curve. As for the surface intersection, it looks like opBoolean does a good job of generating wire bodies. I'll just have to jump through a few hoops to feed it faces and planes as surface bodies.
  • MBartlett21MBartlett21 Member, OS Professional, Developers Posts: 2,034 EDU
    @mahir
    Here is a point FS: https://cad.onshape.com/documents/576d1e60c6cb90985345ac37
    It supports projection, coordinates,and intersection
    mb - draftsman - also FS author: View FeatureScripts
    IR for AS/NZS 1100
  • MBartlett21MBartlett21 Member, OS Professional, Developers Posts: 2,034 EDU
    UPD: and possibly when you will work on Intersection option you can make a subfeature which would create intersection wire body from sets of faces, which is also often needed
    @konstantin_shiriazdanov
    Try this feature: https://cad.onshape.com/documents/84d939daceef6a928b8abcba
    mb - draftsman - also FS author: View FeatureScripts
    IR for AS/NZS 1100
  • konstantin_shiriazdanovkonstantin_shiriazdanov Member Posts: 1,221 ✭✭✭✭✭
    edited July 2018
    thanks @mbartlett21 will use it.  ;) though I would change the position of match type selector after the boolean block like this:

  • mahirmahir Member, Developers Posts: 1,291 ✭✭✭✭✭
    @mahir
    Here is a point FS: https://cad.onshape.com/documents/576d1e60c6cb90985345ac37
    It supports projection, coordinates,and intersection
    That's great you got something going, but the link doesn't lead anywhere.
  • MBartlett21MBartlett21 Member, OS Professional, Developers Posts: 2,034 EDU
    mahir said:
    @mahir
    Here is a point FS: https://cad.onshape.com/documents/576d1e60c6cb90985345ac37
    It supports projection, coordinates,and intersection
    That's great you got something going, but the link doesn't lead anywhere.
    @mahir Sorry, i forgot to make it public :)
    mb - draftsman - also FS author: View FeatureScripts
    IR for AS/NZS 1100
  • mahirmahir Member, Developers Posts: 1,291 ✭✭✭✭✭
    That's better. I see you started with my half finished FS. Not much time for messing with code with a new baby around ¯\_(ツ)_/¯ 
  • MBartlett21MBartlett21 Member, OS Professional, Developers Posts: 2,034 EDU
    thanks @mbartlett21 will use it.  ;) though I would change the position of match type selector after the boolean block like this:

    @konstantin_shiriazdanov
    Try the new version 2.2, which adds localizedInFaces compatibility (With it set to true, it takes faces as input, which is cool)
    mb - draftsman - also FS author: View FeatureScripts
    IR for AS/NZS 1100
  • mahirmahir Member, Developers Posts: 1,291 ✭✭✭✭✭
    edited July 2018
    @mbartlett21 now add point along curve and you'll have all the targeted use cases :) And don't forget to support both length and and ratio along curve.
  • konstantin_shiriazdanovkonstantin_shiriazdanov Member Posts: 1,221 ✭✭✭✭✭
    edited July 2018
    I recently realized that Curve generator FS not only works with parametrized sketches but it actually creates a curve for any set of features that define a point, so having few more ways to define a point becomes more usefull.
    I would also request in this feature option to delete a point or mate connector
  • MBartlett21MBartlett21 Member, OS Professional, Developers Posts: 2,034 EDU
    @mahir
    Done
    I can also add it for multiple points if you want :)
    mb - draftsman - also FS author: View FeatureScripts
    IR for AS/NZS 1100
  • konstantin_shiriazdanovkonstantin_shiriazdanov Member Posts: 1,221 ✭✭✭✭✭
    I can also add it for multiple points if you want
    @mbartlett21 delete multiples would be good, thank you. i need this because some features can create a lot of instances of point/MC's which are later unnececessary. but standart delete body feature can do nothing with it
  • MBartlett21MBartlett21 Member, OS Professional, Developers Posts: 2,034 EDU
    edited July 2018
    mb - draftsman - also FS author: View FeatureScripts
    IR for AS/NZS 1100
  • mahirmahir Member, Developers Posts: 1,291 ✭✭✭✭✭
    @mahir
    Done
    I can also add it for multiple points if you want :)
    Sure, why not ;)
  • MBartlett21MBartlett21 Member, OS Professional, Developers Posts: 2,034 EDU
    @mahir
    Multiple Points along path: DONE!
    mb - draftsman - also FS author: View FeatureScripts
    IR for AS/NZS 1100
  • mahirmahir Member, Developers Posts: 1,291 ✭✭✭✭✭
    @mahir
    Multiple Points along path: DONE!
    Nice work. Glad you have so much time on your hands :smile:

    on opBoolean Plus, can you make it work for surfaces with internal boundaries the same way that Find Intersection does. Either that, or maybe allow Find Intersection to generate either a point OR curve(s)?
  • mahirmahir Member, Developers Posts: 1,291 ✭✭✭✭✭
    edited July 2018
    Now I'm just nitpicking, but can you edit the multi coordinate workflow to be more like the multi along curve? For multi curve you have a variable array input query, but for multi coordinate the user is forced to enter a specially formatted string array. It would be nice if you could just enter X/Y/Z (or R/Th/Z, R/Th/Ph) into their own box and just click "add point" to add another set of inputs, just the along curve.

    For that matter, the single/multi workflow seems to be pretty redundant for all the input types. For along and coordinate, if there is just one input, it's a single. If there is more than one, it's a multi. Same goes for projection. If one vertex is selected, it's a single. If more than one, it's a multi.

    The only "single" input left is intersection. That is currently limited to single points. 3 surfaces with 2 points of intersection currently fails. If possible, try to account for multiple intersections. I would also add support for intersecting curves with surfaces and again try to account for possible multiple intersection points. All these fringe cases are what held up my progress when trying to develop this FS myself, but if you have the time then these additions would make for a lot of versatility :)

    Last, but not least, maybe add an "equal split" option for along curve to create N points equally spaced along a curve, either with or without endpoints.

    All right, my wish list is over ;)
  • MBartlett21MBartlett21 Member, OS Professional, Developers Posts: 2,034 EDU
    @mahir
    I did the multi coordinate input like it is, so it would allow copy-pasting from excel or csv
    mb - draftsman - also FS author: View FeatureScripts
    IR for AS/NZS 1100
  • MBartlett21MBartlett21 Member, OS Professional, Developers Posts: 2,034 EDU
    mahir said:
    @mahir
    Multiple Points along path: DONE!
    Nice work. Glad you have so much time on your hands :smile:

    on opBoolean Plus, can you make it work for surfaces with internal boundaries the same way that Find Intersection does. Either that, or maybe allow Find Intersection to generate either a point OR curve(s)?
    @mahir
    What find intersection does is boolean the two surfaces without any holes, then uses evDistance to find the intersection, as that is the only way i know to get the intersection of a curve and a face.
    mb - draftsman - also FS author: View FeatureScripts
    IR for AS/NZS 1100
  • mahirmahir Member, Developers Posts: 1,291 ✭✭✭✭✭
    What find intersection does is boolean the two surfaces without any holes, then uses evDistance to find the intersection, as that is the only way i know to get the intersection of a curve and a face.
    Right, that's what I figured. I'm just suggesting that opBoolean Plus have that same option to perform the intersection without any internal surface holes. Maybe use a checkbox to turn the option on/off. Ideally, opBoolean could take these internal boundaries into account and generate multiple curves from a surface intersection. But in the mean time, it should at least not fail. 
  • philip_thomasphilip_thomas Member, Moderator, Onshape Employees, Developers Posts: 1,381
    @mbartlett21 - i just found this and really like it - thank you.

    I notice however that the 'Project' option projects to point on the surface that is normal to the surface.
    In my case, i just need the point directly under the point (normal to the sketch containing the seed point).
    Do you have an updated version of this that offers this option?



    Thank you :) 
    Philip Thomas - Onshape
  • mahirmahir Member, Developers Posts: 1,291 ✭✭✭✭✭
    edited August 2018
    @philip_thomas, I’m on my phone, so I can’t check. But @mbartlett21’s Find Intersection FS, or possibly the Intersection option of 3D Point, when intersecting a line and a surface.

    Edit: Nope, I lied. Both 3D Point and Find Intersection only take surfaces inputs. I guess the way around that would be to generate a couple surfaces whose intersection is your green line. Seems like a lot of work though for what seems like it should be a simple operation. @mbartlett21, maybe you can add a "projection direction" option that accepts a plane, planar surface, or linear edge/sketch/curve? Nothing selected = projected normal to target surface.
  • MBartlett21MBartlett21 Member, OS Professional, Developers Posts: 2,034 EDU
    @mahir i can do it like @paul_chastell 's extrude vertex if you want
    mb - draftsman - also FS author: View FeatureScripts
    IR for AS/NZS 1100
  • mahirmahir Member, Developers Posts: 1,291 ✭✭✭✭✭
    @mbartlett21, sure. But Extrude Vertex does a lot more than I don't think is necessary. Just a simple input for projection direction (plane/edge) would be nice.
  • MBartlett21MBartlett21 Member, OS Professional, Developers Posts: 2,034 EDU
    @mahir
    @philip_thomas
    Done!


    It now has projection direction that can be specified (it uses opExtrude internally)
    mb - draftsman - also FS author: View FeatureScripts
    IR for AS/NZS 1100
Sign In or Register to comment.