select element

Need help, or want to share a macro? Post here!
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
schöne
Posts: 12
Joined: Fri Nov 25, 2022 6:42 pm

select element

Post by schöne »

I have mesh just on the boundary how should I change the values of the axis in order to move these meshes to be inside the model.

any idea?

I created the object and the meshes are the points on the boundary not in the boject
Attachments
mesh.PNG
mesh.PNG (40.09 KiB) Viewed 666 times
Last edited by schöne on Thu Dec 01, 2022 5:22 am, edited 3 times in total.
User avatar
Roy_043
Veteran
Posts: 8450
Joined: Thu Dec 27, 2018 12:28 pm

Re: boundary mesh

Post by Roy_043 »

Please post an example file. It it unclear what is meant by boundary and model (aren't the meshes part of the model?).
schöne
Posts: 12
Joined: Fri Nov 25, 2022 6:42 pm

Re: boundary mesh

Post by schöne »

mesh.PNG
mesh.PNG (40.09 KiB) Viewed 671 times
chrisb
Veteran
Posts: 53924
Joined: Tue Mar 17, 2015 9:14 am

Re: boundary mesh

Post by chrisb »

This is still not the example file, only an image of its model. And I have no clue what exactly the problem is. What do you finally want to achieve?
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
schöne
Posts: 12
Joined: Fri Nov 25, 2022 6:42 pm

Re: boundary mesh

Post by schöne »

I have some points(mesh ) on the boundary not inside the object . In order to be these point inside the object I need to change theier position which means that I need know for which values of x,y,z will be these points inisde the object?
User avatar
Roy_043
Veteran
Posts: 8450
Joined: Thu Dec 27, 2018 12:28 pm

Re: boundary mesh

Post by Roy_043 »

To check if a mesh point is inside a shape:

Code: Select all

obj.Shape.isInside(mesh.Mesh.Points[0].Vector)
To get the distance and the nearest point on a Shape:

Code: Select all

dist, pts, geom = obj.Shape.distToShape(Part.Vertex(mesh.Mesh.Points[0].Vector))
To change a point in a mesh:

Code: Select all

old = mesh.Mesh
new = old.copy()
new.setPoint(0, App.Vector(1, 2, 3))
mesh.Mesh = new
schöne
Posts: 12
Joined: Fri Nov 25, 2022 6:42 pm

Re: boundary mesh

Post by schöne »

thank you so much . is it possible to apply this code on some of meshes(sample)?
User avatar
Roy_043
Veteran
Posts: 8450
Joined: Thu Dec 27, 2018 12:28 pm

Re: select element

Post by Roy_043 »

I do not understand anymore. You have meanwhile changed the OP and it no longer matches you original request.
schöne
Posts: 12
Joined: Fri Nov 25, 2022 6:42 pm

Re: select element

Post by schöne »

I mean the code which you posted could we apply it from some selected meshs(points/vertex)
User avatar
Roy_043
Veteran
Posts: 8450
Joined: Thu Dec 27, 2018 12:28 pm

Re: select element

Post by Roy_043 »

Provide a sample file please.
Post Reply