Community
Bifrost Forum
Welcome to the Bifrost Forum. This is the place for artists using Bifrost to ask and answer questions, browse popular topics, and share knowledge about creating effects procedurally using Bifrost. You can also visit the Bifrost Community on AREA to download an array of ready-to-use graphs, read Bifrost news and updates, and find the latest tutorials.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Place object to the base of another

2 REPLIES 2
SOLVED
Reply
Message 1 of 3
darioOrtisi
252 Views, 2 Replies

Place object to the base of another

darioOrtisi
Collaborator
Collaborator

The question is more elaborated then the title. 

I will like to create a plane(directly inside bifrostGraph) wich has the dimension of bounding box of another object and of course will be place at the bottom of the boundingBox(BBOX min in Y axis but will change the axis if needest) 
Now i try in a horrible way. OK the plane is there at the origin it seem correct(look at my screenshot) The problem is that i will like to transfer the dimension to the plane(obviously is a plane so the XZ dimension in this case) 
There is some example somewhere if anybody can helps? 

Thanks

 

darioOrtisi_0-1695804900441.png

 

Place object to the base of another

The question is more elaborated then the title. 

I will like to create a plane(directly inside bifrostGraph) wich has the dimension of bounding box of another object and of course will be place at the bottom of the boundingBox(BBOX min in Y axis but will change the axis if needest) 
Now i try in a horrible way. OK the plane is there at the origin it seem correct(look at my screenshot) The problem is that i will like to transfer the dimension to the plane(obviously is a plane so the XZ dimension in this case) 
There is some example somewhere if anybody can helps? 

Thanks

 

darioOrtisi_0-1695804900441.png

 

2 REPLIES 2
Message 2 of 3

morten.bojsen-hansen
Autodesk
Autodesk
Accepted solution

In the special case you have where the input geometry is aligned with the xz-plane, you can use the following approach (copy paste this into Bifrost Graph):

 

output.pnggraph.png

 

<sub_root>
    <nodes>
        <node>
            <vnnNode name="array_bounds" type="BifrostGraph,Core::Array,array_bounds" flag="0">
    <metadatas>
    <metadata name="DisplayMode">
        <value>2</value>
    </metadata>
    <metadata name="zValue">
        <value>40.000000</value>
    </metadata>
    <metadata name="LayoutPos">
        <value>620 339</value>
    </metadata>
</metadatas>
    <ports>
        <port name="array" type="array&lt;Math::float3&gt;" flag="4096" is_input="yes"/>
        <port name="min_bound" type="Math::float3" flag="4096" is_input="no"/>
        <port name="max_bound" type="Math::float3" flag="4096" is_input="no"/>
    </ports>
</vnnNode>
        </node>
        <node>
            <vnnNode name="get_point_position" type="BifrostGraph,Geometry::Properties,get_point_position" flag="0">
    <metadatas>
    <metadata name="DisplayMode">
        <value>2</value>
    </metadata>
    <metadata name="zValue">
        <value>100.000000</value>
    </metadata>
    <metadata name="LayoutPos">
        <value>315 464</value>
    </metadata>
</metadatas>
    <ports>
        <port name="geometry" type="Object" flag="0" is_input="yes"/>
        <port name="point_position" type="array&lt;Math::float3&gt;" flag="0" is_input="no"/>
    </ports>
</vnnNode>
        </node>
        <node>
            <vnnNode name="create_mesh_cylinder" type="BifrostGraph,Modeling::Primitive,create_mesh_cylinder" flag="0">
    <metadatas>
    <metadata name="DisplayMode">
        <value>2</value>
    </metadata>
    <metadata name="zValue">
        <value>101.000000</value>
    </metadata>
    <metadata name="LayoutPos">
        <value>10 586</value>
    </metadata>
    <metadata name="terminal_node_disabled_flags">
        <value>[
]
</value>
    </metadata>
</metadatas>
    <ports>
        <port name="axis_segments" type="int" flag="0" is_input="yes" default_values="20"/>
        <port name="height_segments" type="int" flag="0" is_input="yes" default_values="4"/>
        <port name="bottom_cap" type="bool" flag="0" is_input="yes" default_values="1"/>
        <port name="top_cap" type="bool" flag="0" is_input="yes" default_values="1"/>
        <port name="radius" type="float" flag="0" is_input="yes" default_values="1"/>
        <port name="height" type="float" flag="0" is_input="yes" default_values="1"/>
        <port name="create_UVs" type="bool" flag="0" is_input="yes" default_values="1"/>
        <port name="up_axis" type="Math::float3" flag="0" is_input="yes" default_values="0;1;0"/>
        <port name="position" type="Math::float3" flag="0" is_input="yes" default_values="0;0;0"/>
        <port name="base_to_pivot" type="bool" flag="0" is_input="yes" default_values="0"/>
        <port name="out_mesh" type="Object" flag="0" is_input="no"/>
    </ports>
</vnnNode>
        </node>
        <node>
            <vnnNode name="vector3_to_scalar1" type="BifrostGraph,Core::Conversion,vector3_to_scalar" flag="0">
    <metadatas>
    <metadata name="DisplayMode">
        <value>2</value>
    </metadata>
    <metadata name="zValue">
        <value>81.000000</value>
    </metadata>
    <metadata name="LayoutPos">
        <value>925 158</value>
    </metadata>
</metadatas>
    <ports>
        <port name="vector3" type="Math::float3" flag="4096" is_input="yes"/>
        <port name="x" type="float" flag="4096" is_input="no"/>
        <port name="y" type="float" flag="4096" is_input="no"/>
        <port name="z" type="float" flag="4096" is_input="no"/>
    </ports>
</vnnNode>
        </node>
        <node>
            <vnnNode name="vector3_to_scalar" type="BifrostGraph,Core::Conversion,vector3_to_scalar" flag="0">
    <metadatas>
    <metadata name="DisplayMode">
        <value>2</value>
    </metadata>
    <metadata name="zValue">
        <value>109.000000</value>
    </metadata>
    <metadata name="LayoutPos">
        <value>925 400</value>
    </metadata>
</metadatas>
    <ports>
        <port name="vector3" type="Math::float3" flag="4096" is_input="yes"/>
        <port name="x" type="float" flag="4096" is_input="no"/>
        <port name="y" type="float" flag="4096" is_input="no"/>
        <port name="z" type="float" flag="4096" is_input="no"/>
    </ports>
</vnnNode>
        </node>
        <node>
            <vnnNode name="subtract1" type="BifrostGraph,Core::Math,subtract" flag="2">
    <metadatas>
    <metadata name="DisplayMode">
        <value>2</value>
    </metadata>
    <metadata name="zValue">
        <value>98.000000</value>
    </metadata>
    <metadata name="LayoutPos">
        <value>1230 10</value>
    </metadata>
</metadatas>
    <ports>
        <port name="x" type="float" flag="4104" is_input="yes"/>
        <port name="x1" type="float" flag="4104" is_input="yes"/>
        <port name="output" type="float" flag="4096" is_input="no"/>
    </ports>
</vnnNode>
        </node>
        <node>
            <vnnNode name="scalar_to_vector3" type="BifrostGraph,Core::Conversion,scalar_to_vector3" flag="0">
    <metadatas>
    <metadata name="DisplayMode">
        <value>2</value>
    </metadata>
    <metadata name="zValue">
        <value>120.000000</value>
    </metadata>
    <metadata name="LayoutPos">
        <value>1230 496</value>
    </metadata>
</metadatas>
    <ports>
        <port name="x" type="float" flag="4096" is_input="yes"/>
        <port name="y" type="float" flag="4096" is_input="yes"/>
        <port name="z" type="float" flag="4096" is_input="yes"/>
        <port name="vector3" type="Math::float3" flag="4096" is_input="no"/>
    </ports>
</vnnNode>
        </node>
        <node>
            <vnnNode name="subtract" type="BifrostGraph,Core::Math,subtract" flag="2">
    <metadatas>
    <metadata name="DisplayMode">
        <value>2</value>
    </metadata>
    <metadata name="LayoutPos">
        <value>1230 253</value>
    </metadata>
    <metadata name="zValue">
        <value>126.000000</value>
    </metadata>
</metadatas>
    <ports>
        <port name="z" type="float" flag="4104" is_input="yes"/>
        <port name="z1" type="float" flag="4104" is_input="yes"/>
        <port name="output" type="float" flag="4096" is_input="no"/>
    </ports>
</vnnNode>
        </node>
        <node>
            <vnnNode name="create_mesh_plane" type="BifrostGraph,Modeling::Primitive,create_mesh_plane" flag="0">
    <metadatas>
    <metadata name="DisplayMode">
        <value>2</value>
    </metadata>
    <metadata name="zValue">
        <value>124.000000</value>
    </metadata>
    <metadata name="LayoutPos">
        <value>1535 270</value>
    </metadata>
    <propertylists>
        <propertylist name="PortExpandedState">
            <metadatas>
                <metadata name="Transform">
                    <value>1</value>
                </metadata>
                <metadata name="Geometry">
                    <value>0</value>
                </metadata>
                <metadata name="Dimensions">
                    <value>1</value>
                </metadata>
            </metadatas>
        </propertylist>
    </propertylists>
</metadatas>
    <ports>
        <port name="length" type="float" flag="0" is_input="yes" default_values="1">
            <metadatas>
                <metadata name="UiSoftMin" value="0"/>
            </metadatas>
        </port>
        <port name="width" type="float" flag="0" is_input="yes" default_values="1">
            <metadatas>
                <metadata name="UiSoftMin" value="0"/>
            </metadatas>
        </port>
        <port name="length_segments" type="int" flag="0" is_input="yes" default_values="10">
            <metadatas>
                <metadata name="UiSoftMin" value="1"/>
            </metadatas>
        </port>
        <port name="width_segments" type="int" flag="0" is_input="yes" default_values="10">
            <metadatas>
                <metadata name="UiSoftMin" value="1"/>
            </metadatas>
        </port>
        <port name="up_axis" type="Math::float3" flag="0" is_input="yes" default_values="0;1;0"/>
        <port name="position" type="Math::float3" flag="0" is_input="yes" default_values="0;0;0"/>
        <port name="plane_mesh" type="Object" flag="0" is_input="no"/>
    </ports>
</vnnNode>
        </node>
        <node>
            <vnnNode name="output" type="" flag="16">
    <metadatas>
    <metadata name="DisplayMode">
        <value>2</value>
    </metadata>
    <metadata name="zValue">
        <value>125.000000</value>
    </metadata>
    <metadata name="LayoutPos">
        <value>1783.91 670.571</value>
    </metadata>
</metadatas>
    <ports>
        <port name="plane_mesh" type="Object" flag="0" is_input="no">
            <metadatas>
                <metadata name="feedbackPort" value=""/>
            </metadatas>
        </port>
        <port name="out_mesh" type="Object" flag="0" is_input="no">
            <metadatas>
                <metadata name="feedbackPort" value=""/>
            </metadatas>
        </port>
    </ports>
</vnnNode>
        </node>
    </nodes>
    <connections>
        <connection output_port="array_bounds.min_bound" input_port="vector3_to_scalar.vector3"/>
        <connection output_port="array_bounds.max_bound" input_port="vector3_to_scalar1.vector3"/>
        <connection output_port="get_point_position.point_position" input_port="array_bounds.array"/>
        <connection output_port="create_mesh_cylinder.out_mesh" input_port="get_point_position.geometry"/>
        <connection output_port="vector3_to_scalar1.x" input_port="subtract1.x1"/>
        <connection output_port="vector3_to_scalar1.z" input_port="subtract.z"/>
        <connection output_port="vector3_to_scalar.x" input_port="subtract1.x"/>
        <connection output_port="vector3_to_scalar.y" input_port="scalar_to_vector3.y"/>
        <connection output_port="vector3_to_scalar.z" input_port="subtract.z1"/>
        <connection output_port="subtract1.output" input_port="create_mesh_plane.length"/>
        <connection output_port="scalar_to_vector3.vector3" input_port="create_mesh_plane.position"/>
        <connection output_port="subtract.output" input_port="create_mesh_plane.width"/>
    </connections>
</sub_root>

 

In the special case you have where the input geometry is aligned with the xz-plane, you can use the following approach (copy paste this into Bifrost Graph):

 

output.pnggraph.png

 

<sub_root>
    <nodes>
        <node>
            <vnnNode name="array_bounds" type="BifrostGraph,Core::Array,array_bounds" flag="0">
    <metadatas>
    <metadata name="DisplayMode">
        <value>2</value>
    </metadata>
    <metadata name="zValue">
        <value>40.000000</value>
    </metadata>
    <metadata name="LayoutPos">
        <value>620 339</value>
    </metadata>
</metadatas>
    <ports>
        <port name="array" type="array&lt;Math::float3&gt;" flag="4096" is_input="yes"/>
        <port name="min_bound" type="Math::float3" flag="4096" is_input="no"/>
        <port name="max_bound" type="Math::float3" flag="4096" is_input="no"/>
    </ports>
</vnnNode>
        </node>
        <node>
            <vnnNode name="get_point_position" type="BifrostGraph,Geometry::Properties,get_point_position" flag="0">
    <metadatas>
    <metadata name="DisplayMode">
        <value>2</value>
    </metadata>
    <metadata name="zValue">
        <value>100.000000</value>
    </metadata>
    <metadata name="LayoutPos">
        <value>315 464</value>
    </metadata>
</metadatas>
    <ports>
        <port name="geometry" type="Object" flag="0" is_input="yes"/>
        <port name="point_position" type="array&lt;Math::float3&gt;" flag="0" is_input="no"/>
    </ports>
</vnnNode>
        </node>
        <node>
            <vnnNode name="create_mesh_cylinder" type="BifrostGraph,Modeling::Primitive,create_mesh_cylinder" flag="0">
    <metadatas>
    <metadata name="DisplayMode">
        <value>2</value>
    </metadata>
    <metadata name="zValue">
        <value>101.000000</value>
    </metadata>
    <metadata name="LayoutPos">
        <value>10 586</value>
    </metadata>
    <metadata name="terminal_node_disabled_flags">
        <value>[
]
</value>
    </metadata>
</metadatas>
    <ports>
        <port name="axis_segments" type="int" flag="0" is_input="yes" default_values="20"/>
        <port name="height_segments" type="int" flag="0" is_input="yes" default_values="4"/>
        <port name="bottom_cap" type="bool" flag="0" is_input="yes" default_values="1"/>
        <port name="top_cap" type="bool" flag="0" is_input="yes" default_values="1"/>
        <port name="radius" type="float" flag="0" is_input="yes" default_values="1"/>
        <port name="height" type="float" flag="0" is_input="yes" default_values="1"/>
        <port name="create_UVs" type="bool" flag="0" is_input="yes" default_values="1"/>
        <port name="up_axis" type="Math::float3" flag="0" is_input="yes" default_values="0;1;0"/>
        <port name="position" type="Math::float3" flag="0" is_input="yes" default_values="0;0;0"/>
        <port name="base_to_pivot" type="bool" flag="0" is_input="yes" default_values="0"/>
        <port name="out_mesh" type="Object" flag="0" is_input="no"/>
    </ports>
</vnnNode>
        </node>
        <node>
            <vnnNode name="vector3_to_scalar1" type="BifrostGraph,Core::Conversion,vector3_to_scalar" flag="0">
    <metadatas>
    <metadata name="DisplayMode">
        <value>2</value>
    </metadata>
    <metadata name="zValue">
        <value>81.000000</value>
    </metadata>
    <metadata name="LayoutPos">
        <value>925 158</value>
    </metadata>
</metadatas>
    <ports>
        <port name="vector3" type="Math::float3" flag="4096" is_input="yes"/>
        <port name="x" type="float" flag="4096" is_input="no"/>
        <port name="y" type="float" flag="4096" is_input="no"/>
        <port name="z" type="float" flag="4096" is_input="no"/>
    </ports>
</vnnNode>
        </node>
        <node>
            <vnnNode name="vector3_to_scalar" type="BifrostGraph,Core::Conversion,vector3_to_scalar" flag="0">
    <metadatas>
    <metadata name="DisplayMode">
        <value>2</value>
    </metadata>
    <metadata name="zValue">
        <value>109.000000</value>
    </metadata>
    <metadata name="LayoutPos">
        <value>925 400</value>
    </metadata>
</metadatas>
    <ports>
        <port name="vector3" type="Math::float3" flag="4096" is_input="yes"/>
        <port name="x" type="float" flag="4096" is_input="no"/>
        <port name="y" type="float" flag="4096" is_input="no"/>
        <port name="z" type="float" flag="4096" is_input="no"/>
    </ports>
</vnnNode>
        </node>
        <node>
            <vnnNode name="subtract1" type="BifrostGraph,Core::Math,subtract" flag="2">
    <metadatas>
    <metadata name="DisplayMode">
        <value>2</value>
    </metadata>
    <metadata name="zValue">
        <value>98.000000</value>
    </metadata>
    <metadata name="LayoutPos">
        <value>1230 10</value>
    </metadata>
</metadatas>
    <ports>
        <port name="x" type="float" flag="4104" is_input="yes"/>
        <port name="x1" type="float" flag="4104" is_input="yes"/>
        <port name="output" type="float" flag="4096" is_input="no"/>
    </ports>
</vnnNode>
        </node>
        <node>
            <vnnNode name="scalar_to_vector3" type="BifrostGraph,Core::Conversion,scalar_to_vector3" flag="0">
    <metadatas>
    <metadata name="DisplayMode">
        <value>2</value>
    </metadata>
    <metadata name="zValue">
        <value>120.000000</value>
    </metadata>
    <metadata name="LayoutPos">
        <value>1230 496</value>
    </metadata>
</metadatas>
    <ports>
        <port name="x" type="float" flag="4096" is_input="yes"/>
        <port name="y" type="float" flag="4096" is_input="yes"/>
        <port name="z" type="float" flag="4096" is_input="yes"/>
        <port name="vector3" type="Math::float3" flag="4096" is_input="no"/>
    </ports>
</vnnNode>
        </node>
        <node>
            <vnnNode name="subtract" type="BifrostGraph,Core::Math,subtract" flag="2">
    <metadatas>
    <metadata name="DisplayMode">
        <value>2</value>
    </metadata>
    <metadata name="LayoutPos">
        <value>1230 253</value>
    </metadata>
    <metadata name="zValue">
        <value>126.000000</value>
    </metadata>
</metadatas>
    <ports>
        <port name="z" type="float" flag="4104" is_input="yes"/>
        <port name="z1" type="float" flag="4104" is_input="yes"/>
        <port name="output" type="float" flag="4096" is_input="no"/>
    </ports>
</vnnNode>
        </node>
        <node>
            <vnnNode name="create_mesh_plane" type="BifrostGraph,Modeling::Primitive,create_mesh_plane" flag="0">
    <metadatas>
    <metadata name="DisplayMode">
        <value>2</value>
    </metadata>
    <metadata name="zValue">
        <value>124.000000</value>
    </metadata>
    <metadata name="LayoutPos">
        <value>1535 270</value>
    </metadata>
    <propertylists>
        <propertylist name="PortExpandedState">
            <metadatas>
                <metadata name="Transform">
                    <value>1</value>
                </metadata>
                <metadata name="Geometry">
                    <value>0</value>
                </metadata>
                <metadata name="Dimensions">
                    <value>1</value>
                </metadata>
            </metadatas>
        </propertylist>
    </propertylists>
</metadatas>
    <ports>
        <port name="length" type="float" flag="0" is_input="yes" default_values="1">
            <metadatas>
                <metadata name="UiSoftMin" value="0"/>
            </metadatas>
        </port>
        <port name="width" type="float" flag="0" is_input="yes" default_values="1">
            <metadatas>
                <metadata name="UiSoftMin" value="0"/>
            </metadatas>
        </port>
        <port name="length_segments" type="int" flag="0" is_input="yes" default_values="10">
            <metadatas>
                <metadata name="UiSoftMin" value="1"/>
            </metadatas>
        </port>
        <port name="width_segments" type="int" flag="0" is_input="yes" default_values="10">
            <metadatas>
                <metadata name="UiSoftMin" value="1"/>
            </metadatas>
        </port>
        <port name="up_axis" type="Math::float3" flag="0" is_input="yes" default_values="0;1;0"/>
        <port name="position" type="Math::float3" flag="0" is_input="yes" default_values="0;0;0"/>
        <port name="plane_mesh" type="Object" flag="0" is_input="no"/>
    </ports>
</vnnNode>
        </node>
        <node>
            <vnnNode name="output" type="" flag="16">
    <metadatas>
    <metadata name="DisplayMode">
        <value>2</value>
    </metadata>
    <metadata name="zValue">
        <value>125.000000</value>
    </metadata>
    <metadata name="LayoutPos">
        <value>1783.91 670.571</value>
    </metadata>
</metadatas>
    <ports>
        <port name="plane_mesh" type="Object" flag="0" is_input="no">
            <metadatas>
                <metadata name="feedbackPort" value=""/>
            </metadatas>
        </port>
        <port name="out_mesh" type="Object" flag="0" is_input="no">
            <metadatas>
                <metadata name="feedbackPort" value=""/>
            </metadatas>
        </port>
    </ports>
</vnnNode>
        </node>
    </nodes>
    <connections>
        <connection output_port="array_bounds.min_bound" input_port="vector3_to_scalar.vector3"/>
        <connection output_port="array_bounds.max_bound" input_port="vector3_to_scalar1.vector3"/>
        <connection output_port="get_point_position.point_position" input_port="array_bounds.array"/>
        <connection output_port="create_mesh_cylinder.out_mesh" input_port="get_point_position.geometry"/>
        <connection output_port="vector3_to_scalar1.x" input_port="subtract1.x1"/>
        <connection output_port="vector3_to_scalar1.z" input_port="subtract.z"/>
        <connection output_port="vector3_to_scalar.x" input_port="subtract1.x"/>
        <connection output_port="vector3_to_scalar.y" input_port="scalar_to_vector3.y"/>
        <connection output_port="vector3_to_scalar.z" input_port="subtract.z1"/>
        <connection output_port="subtract1.output" input_port="create_mesh_plane.length"/>
        <connection output_port="scalar_to_vector3.vector3" input_port="create_mesh_plane.position"/>
        <connection output_port="subtract.output" input_port="create_mesh_plane.width"/>
    </connections>
</sub_root>

 

Message 3 of 3

darioOrtisi
Collaborator
Collaborator

Thank you @morten.bojsen-hansen 

It work perfectly

Thank you very much.

Thank you @morten.bojsen-hansen 

It work perfectly

Thank you very much.

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report