# I encountered a problem in Fisica's FPrismaticJoint setting

**URL:** https://discourse.processing.org/t/i-encountered-a-problem-in-fisicas-fprismaticjoint-setting/15732
**Category:** Processing.py
**Created:** [November 23, 2019, 1:59am UTC](https://discourse.processing.org/t/i-encountered-a-problem-in-fisicas-fprismaticjoint-setting/15732 "2019-11-23T01:59:53Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![Shitou](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/shitou/32/7220_2.png) [@Shitou](https://discourse.processing.org/u/Shitou)
#### Post date: [November 23, 2019, 1:59am UTC](https://discourse.processing.org/t/i-encountered-a-problem-in-fisicas-fprismaticjoint-setting/15732/1 "2019-11-23T01:59:53Z")

</div>

I want to use the [FPrismaticJoint](http://www.ricardmarxer.com/fisica/reference/index.html) in my python mode processing sketch, but when i use setAxis() of the Joint, it never works. I want the Joint to move horizontally。

```auto
add_library('fisica') 
from my_func import *

def setup():
    global world
    size(800, 600)
    Fisica.init(this)   
    world = FWorld()    
    world.setEdges()   
    add_bodys(world)
    
    
    
def draw():
    background(255)
    world.draw()      
    world.step()  
    
       
def add_bodys(w):
    hand_l = FCircle(20)
    set_fbody(hand_l, pos=(200, 400))
    
    hand_r = FCircle(20)
    set_fbody(hand_r, pos=(600, 400))
    
    board = FBox(100, 10)
    set_fbody(board, pos=(400, 500))
    
    ghost = FCircle(20)
    set_fbody(ghost, pos=(30, 30))
    ghost.setStatic(True)
    
    joint_l = FDistanceJoint(hand_l, board)
    joint_l.setFrequency(2)
    joint_l.setAnchor2(-50, 0)
    
    joint_r = FDistanceJoint(hand_r, board)
    joint_r.setFrequency(2)
    joint_r.setAnchor2(50, 0)
    
    ding_l = FPrismaticJoint(hand_l, ghost)
    ding_l.setAxis(0, 1)
    ding_l.setAnchor(100, 400)
    # ding_l.setDrawable(False)
    
    ding_r = FPrismaticJoint(hand_r, ghost)
    ding_r.setAxis(1, 0)
    ding_r.setAnchor(500, 400)
    ding_r.setDrawable(False)
    
    
    [world.add(x) for x in (hand_l, hand_r, board, 
                            ghost, joint_l, joint_r, ding_l, ding_r)]

```

and this is another file(my\_func.py):

```auto
def set_fbody(fbody, pos=None, v=None, f=None, dens=None, damp=None, 
                  rest=None, fric=None, stroke=None, fill=None, img=None):
    if pos:
        fbody.setPosition(*pos)
    if v:
        fbody.setVelocity(*v)
    if f:
        fbody.setForce(*f)
    if dens:
        fbody.setDensity(dens)
    if damp:
        fbody.setDamping(damp)
    if rest:
        fbody.setRestitution(rest)
    if fric:
        fbody.setFriction(fric)
    if stroke:
        fbody.setStroke(*stroke)
    if fill:
        fbody.setFill(*fill)
    if img:
        fbody.attachImage(img)
        

```

---

<div class="post-metadata">

### Author: ![Shitou](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/shitou/32/7220_2.png) [@Shitou](https://discourse.processing.org/u/Shitou)
#### Post date: [November 27, 2019, 5:54am UTC](https://discourse.processing.org/t/i-encountered-a-problem-in-fisicas-fprismaticjoint-setting/15732/2 "2019-11-27T05:54:27Z")

</div>

Help, please, somebody.😂

---

<div class="post-metadata">

### Author: ![Shitou](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/shitou/32/7220_2.png) [@Shitou](https://discourse.processing.org/u/Shitou)
#### Post date: [December 9, 2019, 1:27am UTC](https://discourse.processing.org/t/i-encountered-a-problem-in-fisicas-fprismaticjoint-setting/15732/3 "2019-12-09T01:27:20Z")

</div>

🙃 Maybe I should pull a issue in fisica’s Git.
