Block Constraint

Info about new community or project announcements, implemented features, classes, modules or APIs. Might get technical!
PLEASE DO NOT POST HELP REQUESTS OR OTHER DISCUSSIONS HERE!
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
chrisb
Veteran
Posts: 53933
Joined: Tue Mar 17, 2015 9:14 am

Re: Block Constraint

Post by chrisb »

paullee wrote: Sat Dec 08, 2018 10:50 am Hi, it seems Block Constraint does not work on a point.
It is slightly inconsistent, but the point is a bit special, as it is always construction geometry, which is not exposed to the outside world. So you usually have some edges related to it, otherwise the point is useless. And those edges can be block constrained.
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
abdullah
Veteran
Posts: 4935
Joined: Sun May 04, 2014 3:16 pm
Contact:

Re: Block Constraint

Post by abdullah »

paullee wrote: Sat Dec 08, 2018 10:50 am
abdullah wrote:
Hi, it seems Block Constraint does not work on a point.

So, can only use Lock Constraint as alternative?

Thanks!
Interesting!! I am not sure ATM why. I will add it as an issue for v0.19.

I am not sure what you are trying to do, but Block Constraint is rarely what you want to lock a point, because generally you need to lock a point at an exact value position. In any case, locking a point without editing the values will get you the same behaviour as using the block constraint.
paullee
Veteran
Posts: 5098
Joined: Wed May 04, 2016 3:58 pm

Re: Block Constraint

Post by paullee »

chrisb wrote: Sat Dec 08, 2018 11:15 am It is slightly inconsistent, but the point is a bit special, as it is always construction geometry, which is not exposed to the outside world. So you usually have some edges related to it, otherwise the point is useless. And those edges can be block constrained.
abdullah wrote: Sat Dec 08, 2018 2:19 pm
Interesting!! I am not sure ATM why. I will add it as an issue for v0.19.

I am not sure what you are trying to do, but Block Constraint is rarely what you want to lock a point, because generally you need to lock a point at an exact value position. In any case, locking a point without editing the values will get you the same behaviour as using the block constraint.
Thanks all! Noted abdullah has put it in Mantis.

If possible, a block constraint is better as it do not create dimension line object occupying the screen.

'Better Option'?

Even better, I was thinking (forget if asked in forum) if it is possible in e.g. Sketcher::SketchObjectPython, that some edges could 'turn' into status like the H-Axis/V-Axis that it no longer be 'editable', rather than having a 'constraint' which seem take solver time to process - seems when there is more Block Constraints added, the sketch become sluggish.

Usecase of Block Constraints

BTW, I am using Block Constraints because I find Link to External Geometry is Extremely Vulnerable - a change in the reference object (even the referenced object is sketch) probably break the Link.

Workflow Attempting
  1. I just make the Link to External Geometry as required.
  2. Duplicate the edge with normal edge with say coincidence
  3. Then add Block Constraints to freeze the latter
  4. Remove the External Link so whatever the change in external it does affect the current sketch
  5. Downside is if that particular 'External Edge' is expected to change and need updating and referenced in current sketch, need to do it again manually
  6. At least, it would not 'unexpectedly' frustrate the current sketch when the external geometry is 'updated' without aware of knock-on effect
Realthunder's Assembly 3 branch I remember make some new Sketch Edge Index which is persistent and it no longer 'change' and break link.
chrisb
Veteran
Posts: 53933
Joined: Tue Mar 17, 2015 9:14 am

Re: Block Constraint

Post by chrisb »

Interesting workaround for topological naming issues. And I see that here a block constraint for a point would be sensible.
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
abdullah
Veteran
Posts: 4935
Joined: Sun May 04, 2014 3:16 pm
Contact:

Re: Block Constraint

Post by abdullah »

paullee wrote: Sat Dec 08, 2018 11:55 pm Even better, I was thinking (forget if asked in forum) if it is possible in e.g. Sketcher::SketchObjectPython, that some edges could 'turn' into status like the H-Axis/V-Axis that it no longer be 'editable', rather than having a 'constraint' which seem take solver time to process - seems when there is more Block Constraints added, the sketch become sluggish.
Since Geometry Extensions were introduced, this is indeed possible. It could work similar to the toggling construction geometry tool, but "freezing" the geometry (which color would that be?). Then it would behave exactly as external geometry does from the solver point of view. The solver won't move it. Because it is not connected elsewhere either (externally as external geometry is), then it won't be moved externally either. It will only "move" with the sketch (placement, rotation, ...).

It is not a difficult to implement feature.
paullee wrote: Sat Dec 08, 2018 11:55 pm Usecase of Block Constraints

BTW, I am using Block Constraints because I find Link to External Geometry is Extremely Vulnerable - a change in the reference object (even the referenced object is sketch) probably break the Link.

Workflow Attempting
  1. I just make the Link to External Geometry as required.
  2. Duplicate the edge with normal edge with say coincidence
  3. Then add Block Constraints to freeze the latter
  4. Remove the External Link so whatever the change in external it does affect the current sketch
  5. Downside is if that particular 'External Edge' is expected to change and need updating and referenced in current sketch, need to do it again manually
  6. At least, it would not 'unexpectedly' frustrate the current sketch when the external geometry is 'updated' without aware of knock-on effect
Realthunder's Assembly 3 branch I remember make some new Sketch Edge Index which is persistent and it no longer 'change' and break link.
This use case, I think, might be covered in a more convenient way (for the user) with the merge of RT's sketcher improvements as part of Toponaming. If I remember correctly, he has a "frozen" status on external geometry and some facility to "resync" it. These status are already in master code base as part of ExternalGeometry extension, but they are not functional as it is waiting for the merge.

Nevertheless, with the functionality you indicate above, I think you could achieve the same. Let's see v0.20 development cycle start. Ping me if it appears I forgot ;)
paullee
Veteran
Posts: 5098
Joined: Wed May 04, 2016 3:58 pm

Re: Block Constraint

Post by paullee »

abdullah wrote: Sat Feb 27, 2021 5:52 am Nevertheless, with the functionality you indicate above, I think you could achieve the same. Let's see v0.20 development cycle start. Ping me if it appears I forgot ;)
:D Thanks considering, may i slightly elaborate -

In fact, the steps I describe are automated in the Sketch Feature Python. It record which edge it refer to, if that edge update, my code would remove the Block, move it to sync with the external edge, and Block it again. Why i make something just like Link to External Edge ? Because I use Tag rather than Index, so it survive 'toponaming' problem. I remember all I did was done with you and Realthundar's guidance, thanks :D

It is even better if my feature is achieved not by Block, as it occupy the screen, user may more easily mistakenly select and delete it (it would be automatically reinstated tough). I think I can wait for a while :D
paullee
Veteran
Posts: 5098
Joined: Wed May 04, 2016 3:58 pm

Re: Block Constraint

Post by paullee »

Cross-post to another thread where a Feature Request is made :)

Edges with Block Constraints still Moves
chrisb
Veteran
Posts: 53933
Joined: Tue Mar 17, 2015 9:14 am

Re: Block Constraint

Post by chrisb »

I wouldn't call it feature request, rather the usual post-new-feature-cleanup. I have added a link to this topic.
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
paullee
Veteran
Posts: 5098
Joined: Wed May 04, 2016 3:58 pm

Re: Block Constraint

Post by paullee »

OK "post-new-feature-cleanup", I am updating the bugtracker topic :D
chrisb
Veteran
Posts: 53933
Joined: Tue Mar 17, 2015 9:14 am

Re: Block Constraint

Post by chrisb »

paullee wrote: Fri Jul 02, 2021 8:33 am OK "post-new-feature-cleanup", I am updating the bugtracker topic :D
Thanks!
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
Post Reply