Giter Site home page Giter Site logo

Comments (6)

maxwxyz avatar maxwxyz commented on May 28, 2024 2

It works for me, when the children are directly under the parent object. In you case they are in a group separating them from the parent.
I have not much experience with arch @yorikvanhavre is this the expected behavior or a bug?

from freecad.

furgo16 avatar furgo16 commented on May 28, 2024 1

Thank you for testing. Notice that on the "BIM Getting started" video linked in the issue description, all components are inside groups that are in turn inside the level (Arch_BuildingPart).

So it seems that at least at the point the video was made, the intended behavior was for "Move with host" to work as expected, regardless of whether the components were direct children of the level or indirect children inside a group that was a direct child.

from freecad.

kaiwas avatar kaiwas commented on May 28, 2024

I would not like this behavior to be intended.
A group is simply an element for convenient cataloging. It should not spoil the overall logic.
I perceive this behavior as a bug.

Probably the wall loses connection with the host due to the layer in the form of a group (my guess).
We need to experiment with other objects.

from freecad.

kaiwas avatar kaiwas commented on May 28, 2024

Group "window" objects are not affected in the same way as walls. But when you place a window in a group, another additional entity is created.
In addition, I discovered one more feature. If we “move” to a floor, then nothing happens.
Video example.
Very interesting

2024-04-21.20-57-41.mp4

from freecad.

furgo16 avatar furgo16 commented on May 28, 2024

This issue describes a similar behavior (behaves differently inside or outside groups) with another Arch_BuildingPart property.

If I'm not mistaken, the relevant code for MoveWithHost is:

elif prop == "Placement":
if hasattr(self,"oldPlacement"):
if self.oldPlacement and (self.oldPlacement != obj.Placement):
deltap = obj.Placement.Base.sub(self.oldPlacement.Base)
if deltap.Length == 0:
deltap = None
v = FreeCAD.Vector(0,0,1)
deltar = FreeCAD.Rotation(self.oldPlacement.Rotation.multVec(v),obj.Placement.Rotation.multVec(v))
#print "Rotation",deltar.Axis,deltar.Angle
if deltar.Angle < 0.0001:
deltar = None
for child in obj.Group:
if ((not hasattr(child,"MoveWithHost")) or child.MoveWithHost) and hasattr(child,"Placement"):
#print "moving ",child.Label
if deltar:
#child.Placement.Rotation = child.Placement.Rotation.multiply(deltar) - not enough, child must also move
# use shape methods to obtain a correct placement
import Part
import math
shape = Part.Shape()
shape.Placement = child.Placement
#print("angle before rotation:",shape.Placement.Rotation.Angle)
#print("rotation angle:",math.degrees(deltar.Angle))
shape.rotate(DraftVecUtils.tup(obj.Placement.Base), DraftVecUtils.tup(deltar.Axis), math.degrees(deltar.Angle))
print("angle after rotation:",shape.Placement.Rotation.Angle)
child.Placement = shape.Placement
if deltap:
print("moving child",child.Label)
child.Placement.move(deltap)

from freecad.

kaiwas avatar kaiwas commented on May 28, 2024

The group actually breaks the connection with the host.

In addition, something incomprehensible is happening with the display of the nested element. He disappears. But if you move the parent wall, the child wall appears in the group (but does not move along with the host).

You can say "don't do that and don't use groups." But this feature could be useful in case we need to “catalogue” different types of walls. For example, create a group of internal walls of a house and a group of external walls (within one main wall)..

video-2024-04-22_11.00.47.mp4

from freecad.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.